kennedymr2
Programmer
I have set up a test set of code to connect to an sql database as follows.
It works fine!!!
Dim sqlconnect As Object
Dim sqldata As Object
Dim strSQL As String
Set sqlconnect = CreateObject("ADODB.Connection"
sqlconnect.Open "Driver={SQL Server};Server=tcs\test;Database=northwindcs1;uid=sa;pwd=foo;"
strSQL = "SELECT * FROM customers"
Set sqldata = sqlconnect.Execute(strSQL)
While sqldata.BOF = False And sqldata.EOF = False
varresult = sqldata("customerid"
varResult2 = sqldata("companyname"
Listbox1.AddItem varresult & " " & varResult2
sqldata.MoveNext
Wend
sqldata.MoveFirst
ok to here...... then ERROR !@!@!@!@!@@!!@!@
sqldata.Edit
ERROR = object does not support this property or method
sqldata("customerid"
= "1212"
sqldata.update
================
ie i have a large program written in ado but now have to use an sql database
do not wish to alter the code to much
can the above code be altered to allow these functions under sql
appreciate any help
It works fine!!!
Dim sqlconnect As Object
Dim sqldata As Object
Dim strSQL As String
Set sqlconnect = CreateObject("ADODB.Connection"
sqlconnect.Open "Driver={SQL Server};Server=tcs\test;Database=northwindcs1;uid=sa;pwd=foo;"
strSQL = "SELECT * FROM customers"
Set sqldata = sqlconnect.Execute(strSQL)
While sqldata.BOF = False And sqldata.EOF = False
varresult = sqldata("customerid"
varResult2 = sqldata("companyname"
Listbox1.AddItem varresult & " " & varResult2
sqldata.MoveNext
Wend
sqldata.MoveFirst
ok to here...... then ERROR !@!@!@!@!@@!!@!@
sqldata.Edit
ERROR = object does not support this property or method
sqldata("customerid"
sqldata.update
================
ie i have a large program written in ado but now have to use an sql database
do not wish to alter the code to much
can the above code be altered to allow these functions under sql
appreciate any help