B
Bob Bonta
I was using vbscript in a DTS package on SQL2000 to run some code that had
been working successfully for over a year.
We have recently installed a new SQL2005 server and my taks is to move
everything over from the SQL2000 server to the SQL2005 database.
Before I can even move this into an SSIS on SQL2005, I'm trying to test the
vbscript within MS Access to ensure connection strings and recordsets are
built properly and run successfully.
Below is is my connection string, which seems to be successful:
strConn = "ODBC;Provider=sqloledb;Data Source=servername;Initial
Catalog=dbname;UID=username;PWD=password;"
objConn.Open strConn
Below is the instantiation of the recordset object relying on the success of
the connection object:
Set objRecordset = CreateObject("ADODB.Recordset")
objRecordset.Open strQuery, objConn, adOpenStatic, adLockBatchOptimistic
As I step through the code in MS Access, with a watch on both the connection
object and the recordset object, the evidence suggests that the connection
object is successful but the recordset object is not.
I am getting the following on the recordset object:
strProject = objRecordset("ProjID")
<Item cannot be found in the collection corresponding to the requested name
or ordinal.>
In the watch pane, the value of the objRecordset.EOF property = <Operation
is not allowed when the object is closed>
This is suggesting to me that, although the connection object is open, the
recordset object is never opened.
I am at an impass .... help?!?
been working successfully for over a year.
We have recently installed a new SQL2005 server and my taks is to move
everything over from the SQL2000 server to the SQL2005 database.
Before I can even move this into an SSIS on SQL2005, I'm trying to test the
vbscript within MS Access to ensure connection strings and recordsets are
built properly and run successfully.
Below is is my connection string, which seems to be successful:
strConn = "ODBC;Provider=sqloledb;Data Source=servername;Initial
Catalog=dbname;UID=username;PWD=password;"
objConn.Open strConn
Below is the instantiation of the recordset object relying on the success of
the connection object:
Set objRecordset = CreateObject("ADODB.Recordset")
objRecordset.Open strQuery, objConn, adOpenStatic, adLockBatchOptimistic
As I step through the code in MS Access, with a watch on both the connection
object and the recordset object, the evidence suggests that the connection
object is successful but the recordset object is not.
I am getting the following on the recordset object:
strProject = objRecordset("ProjID")
<Item cannot be found in the collection corresponding to the requested name
or ordinal.>
In the watch pane, the value of the objRecordset.EOF property = <Operation
is not allowed when the object is closed>
This is suggesting to me that, although the connection object is open, the
recordset object is never opened.
I am at an impass .... help?!?