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

Database problem

Status
Not open for further replies.

wallywojo

Programmer
Aug 30, 1999
36
US
I cannot dimension an object as Database or Workspace.&nbsp;&nbsp;I think I must be missing something in the library or components area.&nbsp;&nbsp;Any help is greatly appreciated.<br><br>I am trying to do this<br>cnn1.Execute &quot;delete * from tblUPC&quot;<br>I get an error when I try to insert this as an ADO Recordsource, saying you must open before using object.<br><br>Wally Wojciechowski
 
Wally, for ADO, first you have to make sure you have added references to Microsoft ActiveX Data Obj 2.0 Lib and Microsoft ActiveX Data Obj Recordset 2.0 Lib. <br><br>Dim cnADO as ADODB.Connection<br>Dim rsTableName as ADODB.Recordset<br><br>Set cnADO = New ADODB.Connection<br>Set rsTableName = New ADODB.Recordset<br><br>cnADO.Open psConnectString<br>If cnADO.State = adStateOpen Then<br>Sql = &quot;SELECT * FROM MyTable&quot;<br>rsTableName.Open Sql, cnADO, adOpenDynamic, adLockOptimistic<br>else<br>stuff here<br>endif<br><br>This is a pretty basic example, hope it helps.&nbsp;&nbsp;<br><br>jenneceg
 
I figured it out yesterday afternoon.&nbsp;&nbsp;My problem was trying to mix and match ado and dao.&nbsp;&nbsp;Thank You for your reply jenneceg. <p>Wally Wojciechowski<br><a href=mailto:wwojo@wilsonpet.com>wwojo@wilsonpet.com</a><br><a href= > </a><br>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top