katleemn
15 years agoNew Contributor
Object Required dbConnection
We're new to TestComplete and are trying to bring as much of our existing architecture over as possible.
We use an MS-Access back end for data, and I'm right now writing and calling a sub that opens a connection to that database. The OPEN_CONNECTION function is called from another script (using the USEUNIT statement) and is not erroring. When I try to query that database, however, I get an exception error: Object Required dbConnection.
The last line of code is the one erroring - can anyone help me figure this out? Oh, I have tried defining dbConnection within the GET_DATA, Main, and the Common.OPEN_CONNECTION functions, but it doesn't appear to help. Thanks in advance for your help with a newbie question!
We use an MS-Access back end for data, and I'm right now writing and calling a sub that opens a connection to that database. The OPEN_CONNECTION function is called from another script (using the USEUNIT statement) and is not erroring. When I try to query that database, however, I get an exception error: Object Required dbConnection.
The last line of code is the one erroring - can anyone help me figure this out? Oh, I have tried defining dbConnection within the GET_DATA, Main, and the Common.OPEN_CONNECTION functions, but it doesn't appear to help. Thanks in advance for your help with a newbie question!
'USEUNIT Common
Sub Main
GET_DATA
End Sub
Sub GET_DATA
Common.OPEN_CONNECTION
VI_TESTSET = "CSS001"
Log.Message("Test Set is: " & VI_TESTSET)
Set rsTestSetDB = CreateObject("ADODB.Recordset")
Set rsTestSetDB = dbConnection.Execute("SELECT * FROM TestSets WHERE TestSetID LIKE '" & VI_TESTSET & "%%% ' " & "ORDER BY TestSetID")
End Sub