I'm trying to use a vbscript to update and delete fields in a Pervasive 10.3 database. To begin I wanted to see if I can just view data in a table. I can successfully connect, but when I run a simple query on a table it comes up with this error: NOTE: ddf's and a dsn (Live120) allow me to open the tables in an .mdb. Not sure what I'm doing worng.
Error: Operation is not allowed when the object is closed.
Code: 800A0E78
Source: ADODB.Connection
My code:
Set objConnection = CreateObject("ADODB.Connection")
Set objRecordSet = CreateObject("ADODB.Recordset")
objConnection.Provider = "Provider=PervasiveOLEDB;Data Source=172.24.2.22;"
objConnection.ConnectionString = "Driver={Pervasive ODBC Engine Interface};ServerDSN=Live120;UID=strUID;PWD=strPWD;ServerName=Lesk-pc;"
objRecordset.CursorLocation = adUseClient
If objConnection.State = adStateOpen Then
MsgBox "Connected to Live120 on Lesk-pc." (contionusly shows connected)
Else
MsgBox "Error connecting to Live120 Lesk-pc."
End If
mySQLquerry = "SELECT * FROM " & Chr(34) & "bldg" & Chr(34) also tried "select * from bldg"
(Fails here with above error) set rstemp = objConnection.Execute(mySQLquerry)
Do While Not rstemp.EOF
MsgBox rstemp("bldg_desc")
rstemp.MoveNext
Loop
rstemp.Close
objConnection.Close
Any help at all would be appreciated. Thanks les