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!

Queys and ADODC 1

Status
Not open for further replies.

lathodio

Programmer
Mar 25, 2000
9
SI
I am trying to link an ADODC data control to a datagrid that accesses an mdb database.&nbsp;&nbsp;I t is very simple however I am not able to do it.&nbsp;&nbsp;<br><br>What would you do.&nbsp;&nbsp;(1)Form (1) AdoDc data control (1) Microsoft access database. Query the database for last name field with an input box.<br><br>ANY TAKERS?
 
This is a post I made to another message, basically could share the same info, and might have extra info you want<br>&quot;<br>There has always been problems with Access2000 And Development, which is why most people(or my entire office for that matter) went to Access97, although you might be able to fix it by seclecting Microsoft ADO 2.1(active Data object) from the project componet list.(has to be 2.1 at least)<br>Heres a small example that might help in the generic usage of ADO when opening a DB(in the ODBC32 control in Control pannel, goto SystenDSN add a new Access DB , and link the Database Section to the one you are wanting to use, (leave system database frame blank, and DSN name is what you want to call it when you use it in your programs)<br><br>Dim Con As New ADODB.Connection<br>Dim strSQL As String<br>strSQL = &quot;SELECT * FROM Table1&quot;<br>Dim rs As New Recordset<br>Con.Open &quot;DSN=GNO;UID=;PWD=;&quot;<br>Set rs = Con.Execute(strSQL)<br>While Not rs.EOF<br>List1.AddItem rs(&quot;Groups&quot;).Value<br>rs.MoveNext<br>Wend<br>rs.Close<br><br>the strSQL is the variable I used to stick my SQL command, as you notice the Con.Open, I used a DSN name, which is alot easier. further questions? let me know<br>also any SQL command that does immediate tasks, like Delete, Update, Insert, does not have to be closed(rs.Close), only select query , and anything else that keeps the recordset open for your viewing.<br><br>-hope this helps <br>&quot;<br> <p>Karl<br><a href=mailto:kb244@kb244.8m.com>kb244@kb244.8m.com</a><br><a href= </a><br>Experienced in , or have messed with : VC++, Borland C++ Builder, VJ++6(starting),VB-Dos, VB1 thru VB6, Delphi 3 pro, Borland C++ 3(DOS), Borland C++ 4.5, HTML, ASP(somewhat), QBasic(least i didnt start with COBOL)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top