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

access - VB problem

Status
Not open for further replies.

danab

Programmer
Feb 11, 2000
3
IL
I have been using ADO as a connection tool for access 97. <br>All was good. <br>I recently changed to access 2000. <br>suddenly things went bad. <br>I could not connect using DAO - I got an error message telling me the file format is unrecodnized after converting the mdb file to access 2000 format. <br>Has the world gone mad??? <br>Is there somthing I'm missing ? <br>Thanks. <br>Dan.<br>
 
I use this syntax in Access 2000 for ADO<br><br>&nbsp;&nbsp;&nbsp;&nbsp;Dim mKey As Integer, RSMT As New Recordset, cnn As ADODB.Connection<br>&nbsp;&nbsp;&nbsp;&nbsp;Dim SqlString As String, CNT As Integer<br>&nbsp;&nbsp;&nbsp;&nbsp;Set cnn = CurrentProject.Connection&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;RSMT.Open SqlString, cnn, adOpenStatic, adLockReadOnly<br><br>For DAO this syntax:<br><br>Dim SqlString As String<br>Dim RSMT As DAO.Recordset, dbs As DAO.Database<br>Set dbs = CurrentDb<br>SqlString = &quot;UPDATE Equipment &quot; _<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;& &quot;SET equipmentName = &quot; & &quot;&quot;&quot;Samuel Adams&quot;&quot;&quot; _<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;& &quot; WHERE equipmentKey = 1 ;&quot;<br>dbs.Execute SqlString<br><br>Make sure you have the right reference libraries checked for DAO<br><br>Go under Tools and pick References then make sure the &quot; Microsoft DAO 3.6&quot; is checked or an equivalent to DAO 3.6<br><br>The nice thing about DAO is it lets you do a RecordSetClone which can't be done with ADO or at least it never worked for me.<br><br>Jerry<br>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top