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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

recordset error

Status
Not open for further replies.

hugz

Programmer
Jun 3, 2003
8
0
0
GB
hello,

i am getting an error from my browser saying 'object required' on the line

RS.Open sql, cnn

where the sql and the cnn settings are correct coz i've used them in other scripts.

please help as this is driving me insane

thanks
 
Is "RS" correctly defined as as recorset object?
 
Please post the rest of the script. Also make sure every object has been set. I personaly like to establish my recorset as follows...

Dim strCon
Dim strSQL
Dim objRecordSet

Set objRecordSet = Sever.CreateObject("ADODB.RecordSet")

'Pick One'''''''''''''''''''''''''''''''''''''''
strCon = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=yourdata.mdb;"'Access Connection
'strCon= "Provider=SQLOLEDB;Server=sqlServer;Uid=sa;Pwd=password;Database=yourdata" 'SQL Server Connection
''''''''''''''''''''''''''''''''''''''''''''''''

strSQL = "SELECT * FROM YourTable"

objRecordSet.ActiveConnection = strConn
objRecordSet.Source = strSQL
objRecordSet.CursorLocation = 3
objRecordSet.LockType = 3
objRecordSet.CursorType = 0
objRecordSet.Open


objRecordSet.Close

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top