Showing posts with label basic. Show all posts
Showing posts with label basic. Show all posts

Friday, March 23, 2012

Invalid object name 'Product'.

HI I'M NEWBIES in visual Basic with Sql Server
i try to make a database with stored procedure and whan i run the program the give an error

"Invalid object name 'Product'."

i dont know how to fix it here is my code
Dim sqlcon As New SqlClient.SqlConnection
sqlcon.ConnectionString = "Data Source=WISEMAN\SQLEXPRESS;Initial Catalog=Product;Integrated Security=True;Pooling=False;uid=uid;pwd=pwd "
Dim cmd As New SqlClient.SqlCommand
cmd.Connection = sqlcon
cmd.CommandType = CommandType.StoredProcedure
cmd.CommandText = "insertcustomer"
cmd.Parameters.AddWithValue("@.Productid", TextBox1.Text)
cmd.Parameters.AddWithValue("@.detail", TextBox2.Text)
sqlcon.Open()
cmd.ExecuteScalar()
cmd.ExecuteNonQuery()
sqlcon.Close()

the error at line is cmd.executescalar()
My database name is product
my name for my storedprocedure is insertcustomer
Code for insertcustomer
ALTER PROCEDURE dbo.InsertCustomer
(

@.ProductID int output,
@.detail varchar(50)
)

AS
SET NOCOUNT ON

INSERT INTO Productdetail
(detail)
VALUES
(@.detail);

IF @.@.ROWCOUNT>0 AND @.@.ERROR>0

SELECT @.Detail = detail

From Productdetail
Where (ProductID =SCOPE_IDENTITY())

if u have any idee please tell meHi shadwise,

Welcome to thescripts. I'm sure you will find a wealth of information ion the various forums here. I am moving this thread to the SQL server forum. You will still be able to access this particular thread through the introductions page, but future questions should be directed to the appropriate forum (which you will find by selecting "forums" on the blue bar near the top of your screen.

I hope the experts in the SQL server forum can help with your query!!|||

Quote:

Originally Posted by shadwise

...i dont know how to fix it here is my code...
if u have any idee please tell me


Does your server or database have case-sensitive collation? Please copy/paste complete error description.
I'm not sure about "Invalid object name 'Product'" problem, but there are several other problem worth mentioning:Wrap SqlConnection and SqlCommand scope with using (C# keyword, don't know correct VB syntax)

Monday, March 19, 2012

Invalid Export DLL or export format

I have read a lot about this error and all the suggestions put in place in order to have it working to no avail.We have a Visual Basic 6 application and we are able to export reports to Word,PDF or EXCEl through Report viewer, however for sometime we have had problems exporting to PDF on Terminal Server 2000, now that we upgraded to TS 2003 none of the exports work,exporting to pdf or excel gives an error as discribed in the subject and to word just doesn't happen, no error is thrown.

I have made sure I have all the appropriate dll in c\windows\crystal. the only thing that strikes me as strange is, I have found a post informing we should have all of those dll files under c\program files\common files\crystal decisions\2.0\bin and there is the need to have files in MergeModules as well, however those folders do not exist on the TS where Crystal Reports 8.5 was installed.

I have crystal installed on my own pc and i have all of those folders but since exporting locally on our pcs is not the problem but on the Terminal Server I can't connect if that could be the problem, but person that I helping with this refuses to create those folders because he thinks they are not needed.

Would somebody know are those folders that are getting created when Crystal is istalled and if i should just create them myself.

Hope somebody can help because i am really stuck.

ThanksYou need to create Setup from the Package and Deployment wiward and add all the necessary files/dlls so that they will be copied to the corresponding directories in the system where set up is run

Invalid Descriptor Ind

I am using Crystal Reports 8.0 in Visual Basic 6.0 With SQL Server 7.0.
When I pass the parameters to the report to see the results the following
error message appears
"ODBC Error : [Microsoft][ODBC SQL Server Driver]Invalid Descriptor Index"
Can anyone help me.
Saqib
Looks like a SQLGetData error
This artical may helps
http://msdn.microsoft.com/library/de...us/odbc/htm/od
bcusing_sqlbindcol.asp
...
There are a number of restrictions on using SQLGetData. In general, columns
accessed with SQLGetData:
Must be accessed in order of increasing column number (because of the way
the columns of a result set are read from the data source). For example, it
is an error to call SQLGetData for column 5 and then call it for column 4.
Cannot be bound.
Must have a higher column number than the last bound column. For example,
if the last bound column is column 3, it is an error to call SQLGetData for
column 2. For this reason, applications should be careful to place long
data columns at the end of the select list.

Invalid Descriptor Ind

I am using Crystal Reports 8.0 in Visual Basic 6.0 With SQL Server 7.0.
When I pass the parameters to the report to see the results the following
error message appears
"ODBC Error : [Microsoft][ODBC SQL Server Driver]Invalid Descriptor
Index"
Can anyone help me.
SaqibLooks like a SQLGetData error
This artical may helps
http://msdn.microsoft.com/library/d...-us/odbc/htm/od
bcusing_sqlbindcol.asp
...
There are a number of restrictions on using SQLGetData. In general, columns
accessed with SQLGetData:
Must be accessed in order of increasing column number (because of the way
the columns of a result set are read from the data source). For example, it
is an error to call SQLGetData for column 5 and then call it for column 4.
Cannot be bound.
Must have a higher column number than the last bound column. For example,
if the last bound column is column 3, it is an error to call SQLGetData for
column 2. For this reason, applications should be careful to place long
data columns at the end of the select list.

Friday, March 9, 2012

Invalid authorization specification

MS OLE DB Provider for SQL Server Error: Invalid authorization specification
This is a basic 3-tier system, front end, data broker, database. The front
end software is written in VB 6. There are many front end users. This
error is coming up on one computer only. No users can access the database
through the software from this machine. But, all users can access the
database through the software from all other machines. This machine is WinXP.
Any ideas where to look? The software and connection code is the same on
all machines. What could have changed on this one machine (because it did
work before) that would cause only it to stop working properly?
Thanks.
Does your application use a DSN to connect to SQL Server? If so ensure this
DSN is setup correctly on the client machine.
This error is similar to the "login failed for user <usr>" Thus you should
troubleshoot it similarly. For instrance, try connecting from this client
using both SQL and NT authentication. To simplify troubleshooting, try
taking your application out of the picture by testing UDL file connections
and from odbc administrator(test dsn). Is the same error displayed when
testing connectivity using these client tools?
Also see KB: How to troubleshoot connectivity issues in SQL Server 2000 -
ID: 827422 9available at http://support.microsoft.com)
Fany Vargas
Microsoft Corporation
This posting is provided "AS IS" with no warranties, and confers no rights.
Are you secure? For information about the Strategic Technology Protection
Program and to order your FREE Security Tool Kit, please visit
http://www.microsoft.com/security.
Microsoft highly recommends that users with Internet access update their
Microsoft software to better protect against viruses and security
vulnerabilities. The easiest way to do this is to visit the following
websites:
http://www.microsoft.com/protect
http://www.microsoft.com/security/guidance/default.mspx

Wednesday, March 7, 2012

Invalid authorization specification

MS OLE DB Provider for SQL Server Error: Invalid authorization specification
This is a basic 3-tier system, front end, data broker, database. The front
end software is written in VB 6. There are many front end users. This
error is coming up on one computer only. No users can access the database
through the software from this machine. But, all users can access the
database through the software from all other machines. This machine is WinX
P.
Any ideas where to look? The software and connection code is the same on
all machines. What could have changed on this one machine (because it did
work before) that would cause only it to stop working properly?
Thanks.Does your application use a DSN to connect to SQL Server? If so ensure this
DSN is setup correctly on the client machine.
This error is similar to the "login failed for user <usr>" Thus you should
troubleshoot it similarly. For instrance, try connecting from this client
using both SQL and NT authentication. To simplify troubleshooting, try
taking your application out of the picture by testing UDL file connections
and from odbc administrator(test dsn). Is the same error displayed when
testing connectivity using these client tools?
Also see KB: How to troubleshoot connectivity issues in SQL Server 2000 -
ID: 827422 9available at http://support.microsoft.com)
Fany Vargas
Microsoft Corporation
This posting is provided "AS IS" with no warranties, and confers no rights.
Are you secure? For information about the Strategic Technology Protection
Program and to order your FREE Security Tool Kit, please visit
http://www.microsoft.com/security.
Microsoft highly recommends that users with Internet access update their
Microsoft software to better protect against viruses and security
vulnerabilities. The easiest way to do this is to visit the following
websites:
http://www.microsoft.com/protect
http://www.microsoft.com/security/guidance/default.mspx

Friday, February 24, 2012

Interrogating SQL Server Tables for Specific Values

Does anyone have a routine that interrogates tables looking for
specific values. I as a basic routine that works using MS Access. I
first create a table that has all the table names and field names per
table, like:
xyzField
Table Field
Table1 Field1
Table1 Field2
Table1 Field3
Table2 Field1
Table2 Field2
Table2 Field3
...
xyzResults has three text columns:
TableName, FieldName, SearchValue
The I run the routine:
Function InterrogateDB()
On Error GoTo Err_Line
Dim db As DAO.Database
Dim rsXYZFields As DAO.Recordset
Dim mTable As String
Dim mField As String
Dim strSQL As String
Dim strFIND As String
strFIND = InputBox("Enter the field name fragment:")
Set db = CurrentDb
'Open the Table/Fields table
Set rsXYZFields = db.OpenRecordset("xyzField", dbOpenSnapshot)
With rsXYZFields
.MoveFirst
Do Until .EOF
mTable = "[" & Trim(.Fields(0)) & "]"
mField = "[" & Trim(.Fields(1)) & "]"
If DCount("*", mTable, mField & " Like '*" & _
strFIND & "*'") > 0 Then
strSQL = "INSERT INTO xyzResults ( TableName, " &
_
"FieldName, SearchValue ) VALUES ( '" & mTable &
"', '" & _
mField & "', '" & strFIND & "' )"
db.Execute strSQL, dbFailOnError
End If
.MoveNext
Loop
End With
rsXYZFields.Close
Set rsXYZFields = Nothing
db.Close
Set db = Nothing
Exit Function
Err_Line:
MsgBox "Error occurred when inserting record"
Resume Next
End Function
==============================
It prompts me for the value that I am looking for, then interrogates
all the tables and fields for that value. Is there a procedure
similar to this I can use in SQL Server?
Any help appreciated!
Thanks,
RBollingerHi
"robboll" wrote:
> Does anyone have a routine that interrogates tables looking for
> specific values. I as a basic routine that works using MS Access. I
> first create a table that has all the table names and field names per
> table, like:
> xyzField
> Table Field
> Table1 Field1
> Table1 Field2
> Table1 Field3
> Table2 Field1
> Table2 Field2
> Table2 Field3
> ...
> xyzResults has three text columns:
> TableName, FieldName, SearchValue
> The I run the routine:
> Function InterrogateDB()
> On Error GoTo Err_Line
>
> Dim db As DAO.Database
> Dim rsXYZFields As DAO.Recordset
> Dim mTable As String
> Dim mField As String
> Dim strSQL As String
> Dim strFIND As String
> strFIND = InputBox("Enter the field name fragment:")
> Set db = CurrentDb
> 'Open the Table/Fields table
> Set rsXYZFields = db.OpenRecordset("xyzField", dbOpenSnapshot)
>
> With rsXYZFields
> .MoveFirst
> Do Until .EOF
> mTable = "[" & Trim(.Fields(0)) & "]"
> mField = "[" & Trim(.Fields(1)) & "]"
> If DCount("*", mTable, mField & " Like '*" & _
> strFIND & "*'") > 0 Then
> strSQL = "INSERT INTO xyzResults ( TableName, " &
> _
> "FieldName, SearchValue ) VALUES ( '" & mTable &
> "', '" & _
> mField & "', '" & strFIND & "' )"
> db.Execute strSQL, dbFailOnError
> End If
> .MoveNext
> Loop
> End With
> rsXYZFields.Close
> Set rsXYZFields = Nothing
> db.Close
> Set db = Nothing
> Exit Function
>
> Err_Line:
> MsgBox "Error occurred when inserting record"
> Resume Next
> End Function
> ==============================> It prompts me for the value that I am looking for, then interrogates
> all the tables and fields for that value. Is there a procedure
> similar to this I can use in SQL Server?
> Any help appreciated!
> Thanks,
> RBollinger
>
Have you checked out
http://www.users.drew.edu/skass/sql/SearchAllTables.sql.txt
John

Sunday, February 19, 2012

Interrogating SQL Server Tables for Specific Values

Does anyone have a routine that interrogates tables looking for
specific values. I as a basic routine that works using MS Access. I
first create a table that has all the table names and field names per
table, like:
xyzField
Table Field
Table1 Field1
Table1 Field2
Table1 Field3
Table2 Field1
Table2 Field2
Table2 Field3
...
xyzResults has three text columns:
TableName, FieldName, SearchValue
The I run the routine:
Function InterrogateDB()
On Error GoTo Err_Line
Dim db As DAO.Database
Dim rsXYZFields As DAO.Recordset
Dim mTable As String
Dim mField As String
Dim strSQL As String
Dim strFIND As String
strFIND = InputBox("Enter the field name fragment:")
Set db = CurrentDb
'Open the Table/Fields table
Set rsXYZFields = db.OpenRecordset("xyzField", dbOpenSnapshot)
With rsXYZFields
.MoveFirst
Do Until .EOF
mTable = "[" & Trim(.Fields(0)) & "]"
mField = "[" & Trim(.Fields(1)) & "]"
If DCount("*", mTable, mField & " Like '*" & _
strFIND & "*'") > 0 Then
strSQL = "INSERT INTO xyzResults ( TableName, " &
_
"FieldName, SearchValue ) VALUES ( '" & mTable &
"', '" & _
mField & "', '" & strFIND & "' )"
db.Execute strSQL, dbFailOnError
End If
.MoveNext
Loop
End With
rsXYZFields.Close
Set rsXYZFields = Nothing
db.Close
Set db = Nothing
Exit Function
Err_Line:
MsgBox "Error occurred when inserting record"
Resume Next
End Function
==============================
It prompts me for the value that I am looking for, then interrogates
all the tables and fields for that value. Is there a procedure
similar to this I can use in SQL Server?
Any help appreciated!
Thanks,
RBollingerHi
"robboll" wrote:

> Does anyone have a routine that interrogates tables looking for
> specific values. I as a basic routine that works using MS Access. I
> first create a table that has all the table names and field names per
> table, like:
> xyzField
> Table Field
> Table1 Field1
> Table1 Field2
> Table1 Field3
> Table2 Field1
> Table2 Field2
> Table2 Field3
> ...
> xyzResults has three text columns:
> TableName, FieldName, SearchValue
> The I run the routine:
> Function InterrogateDB()
> On Error GoTo Err_Line
>
> Dim db As DAO.Database
> Dim rsXYZFields As DAO.Recordset
> Dim mTable As String
> Dim mField As String
> Dim strSQL As String
> Dim strFIND As String
> strFIND = InputBox("Enter the field name fragment:")
> Set db = CurrentDb
> 'Open the Table/Fields table
> Set rsXYZFields = db.OpenRecordset("xyzField", dbOpenSnapshot)
>
> With rsXYZFields
> .MoveFirst
> Do Until .EOF
> mTable = "[" & Trim(.Fields(0)) & "]"
> mField = "[" & Trim(.Fields(1)) & "]"
> If DCount("*", mTable, mField & " Like '*" & _
> strFIND & "*'") > 0 Then
> strSQL = "INSERT INTO xyzResults ( TableName, " &
> _
> "FieldName, SearchValue ) VALUES ( '" & mTable &
> "', '" & _
> mField & "', '" & strFIND & "' )"
> db.Execute strSQL, dbFailOnError
> End If
> .MoveNext
> Loop
> End With
> rsXYZFields.Close
> Set rsXYZFields = Nothing
> db.Close
> Set db = Nothing
> Exit Function
>
> Err_Line:
> MsgBox "Error occurred when inserting record"
> Resume Next
> End Function
> ==============================
> It prompts me for the value that I am looking for, then interrogates
> all the tables and fields for that value. Is there a procedure
> similar to this I can use in SQL Server?
> Any help appreciated!
> Thanks,
> RBollinger
>
Have you checked out
http://www.users.drew.edu/skass/sql...lTables.sql.txt
John

Interrogating SQL Server Tables for Specific Values

Does anyone have a routine that interrogates tables looking for
specific values. I as a basic routine that works using MS Access. I
first create a table that has all the table names and field names per
table, like:
xyzField
Table Field
Table1 Field1
Table1 Field2
Table1 Field3
Table2 Field1
Table2 Field2
Table2 Field3
...
xyzResults has three text columns:
TableName, FieldName, SearchValue
The I run the routine:
Function InterrogateDB()
On Error GoTo Err_Line
Dim db As DAO.Database
Dim rsXYZFields As DAO.Recordset
Dim mTable As String
Dim mField As String
Dim strSQL As String
Dim strFIND As String
strFIND = InputBox("Enter the field name fragment:")
Set db = CurrentDb
'Open the Table/Fields table
Set rsXYZFields = db.OpenRecordset("xyzField", dbOpenSnapshot)
With rsXYZFields
.MoveFirst
Do Until .EOF
mTable = "[" & Trim(.Fields(0)) & "]"
mField = "[" & Trim(.Fields(1)) & "]"
If DCount("*", mTable, mField & " Like '*" & _
strFIND & "*'") > 0 Then
strSQL = "INSERT INTO xyzResults ( TableName, " &
_
"FieldName, SearchValue ) VALUES ( '" & mTable &
"', '" & _
mField & "', '" & strFIND & "' )"
db.Execute strSQL, dbFailOnError
End If
.MoveNext
Loop
End With
rsXYZFields.Close
Set rsXYZFields = Nothing
db.Close
Set db = Nothing
Exit Function
Err_Line:
MsgBox "Error occurred when inserting record"
Resume Next
End Function
==============================
It prompts me for the value that I am looking for, then interrogates
all the tables and fields for that value. Is there a procedure
similar to this I can use in SQL Server?
Any help appreciated!
Thanks,
RBollinger
Hi
"robboll" wrote:

> Does anyone have a routine that interrogates tables looking for
> specific values. I as a basic routine that works using MS Access. I
> first create a table that has all the table names and field names per
> table, like:
> xyzField
> Table Field
> Table1 Field1
> Table1 Field2
> Table1 Field3
> Table2 Field1
> Table2 Field2
> Table2 Field3
> ...
> xyzResults has three text columns:
> TableName, FieldName, SearchValue
> The I run the routine:
> Function InterrogateDB()
> On Error GoTo Err_Line
>
> Dim db As DAO.Database
> Dim rsXYZFields As DAO.Recordset
> Dim mTable As String
> Dim mField As String
> Dim strSQL As String
> Dim strFIND As String
> strFIND = InputBox("Enter the field name fragment:")
> Set db = CurrentDb
> 'Open the Table/Fields table
> Set rsXYZFields = db.OpenRecordset("xyzField", dbOpenSnapshot)
>
> With rsXYZFields
> .MoveFirst
> Do Until .EOF
> mTable = "[" & Trim(.Fields(0)) & "]"
> mField = "[" & Trim(.Fields(1)) & "]"
> If DCount("*", mTable, mField & " Like '*" & _
> strFIND & "*'") > 0 Then
> strSQL = "INSERT INTO xyzResults ( TableName, " &
> _
> "FieldName, SearchValue ) VALUES ( '" & mTable &
> "', '" & _
> mField & "', '" & strFIND & "' )"
> db.Execute strSQL, dbFailOnError
> End If
> .MoveNext
> Loop
> End With
> rsXYZFields.Close
> Set rsXYZFields = Nothing
> db.Close
> Set db = Nothing
> Exit Function
>
> Err_Line:
> MsgBox "Error occurred when inserting record"
> Resume Next
> End Function
> ==============================
> It prompts me for the value that I am looking for, then interrogates
> all the tables and fields for that value. Is there a procedure
> similar to this I can use in SQL Server?
> Any help appreciated!
> Thanks,
> RBollinger
>
Have you checked out
http://www.users.drew.edu/skass/sql/SearchAllTables.sql.txt
John

interoperability bw SQL mobile and j2me application

Hi

guys.

Is it possible to interoperate between SQL mobile and applications developed in j2me?

I need my application in j2me to perorm the basic database operations in sql mobile db.

Please advise

Thanks

Not unless somebody implemented whatever interface J2ME uses for databases (JDBC?) for SQL CE or J2ME now supports OLEDB (and COM in general).