Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ODBC and SQL

Status
Not open for further replies.

ufobaby

MIS
Sep 25, 2001
238
US
hi below is the code
====================
Dim objRs As ADODB.Recordset
Dim objConn As ADODB.Connection

Set objConn = New ADODB.Connection
objConn.ConnectionString = "driver={SQL Server};" & _
"server=ufobaby99;uid=niraj;pwd=abc123;database=test_niraj"
objConn.Open
[red]
Set objRs = New ADODB.Recordset
[/red]
objRs.CursorType = adOpenKeyset
objRs.Open "tbl_login", objConn, , , adCmdTable
MsgBox "1"
objRs.MoveLast
objRs.AddNew
MsgBox "2"
objRs("cod_user") = "niraj0000"
objRs("txt_username") = "niraj"
objRs("txt_pwd") = "niraj"
objRs("category") = "admin"
objRs.Update

MsgBox "Updated", vbInformation
=================================
get the following error at the highlighted line
Err Number = -2147217887
Err Desc = ODBC driver does not support the requested properties.

am using SQL Server 2000 and Windows 2000 Adv Server with VB 6.0

pls help !!!!

[cheers]
Niraj
[noevil]
 
Your error is actually being generated when you try to open your recordset.
What is "tbl_login"?
You may need to remove the "". I can tell you more when I determine what the tbl_login object is.

B
 
The underscore in the table name may also be causing a problem. either qualify the table name with square brackets or rename it without the underscore.

objRs.Open "[tbl_login]", objConn, , , adCmdTable


Thanks and Good Luck!

zemp
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top