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!

VB6, Access2000 and ADO 1

Status
Not open for further replies.

allyeric

Programmer
Mar 14, 2000
104
CA
I am trying to connect my app created in VB6 to a datbase created in Access 2000. I have searched many places to find correct way to do this, and have only managed to get myself even more confused! I have a basic understanding of the ADO control, I have tried many different ways - but I can't seem to get it to open or access the database. Any help in this would be greatly appreciated, and would stop me from pulling out the rest of my hair! You may either reply here, or to my email : <A HREF="mailto:allyeric@sprint.ca">allyeric@sprint.ca</A><br>
<br>
Thanks in advance<br>
allyeric
 
Well your not the first person with this problem.<br>
There are several Posts a ways back.<br>
I think VB6 came out before Access 2000 so it does not have the latest Jet .DLL <p> DougP<br><a href=mailto: dposton@universal1.com> dposton@universal1.com</a><br><a href= > </a><br>
 
hehe my entire office stuck with Access97 for our development purposes due to heavy probs with the 2000 version <p>Karl<br><a href=mailto:kb244@bellsouth.net>kb244@bellsouth.net</a><br><a href= </a><br>Experienced in , or have messed with : VC++, Borland C++ Builder, VB-Dos, VB1 thru VB6, Delphi 3 pro, Borland C++ 3(DOS), Borland C++ 4.5, HTML, ASP(somewhat), QBasic(hehe, yea it was 4.5 too, least i didnt start with COBOL)
 
According to microsoft (yeah, right) if you have servicepack III for VB6 you will get the ActiveX Data Objects library 2.1 instead of 2.0 which comes with VB6 and this will enable you to connect with Access 2000. However, our office has done the same as kb244 and stuck with Access97 out of fear of buginess in the 2.1 version.
 
I do have library 2.1. I have Microsoft ActiveX Data Objects Recordset 2.1 library, and Microsoft ActiveX Data Objects 2.1 library. At the moment, am using Recordset - when I tried to add the other, tells me name conflicts with existing module, project, or object library. I take it I can only use one of these libraries - which do I choose?
 
I would stick with the one of more confidence, the 2k version is still too new to garantee there isnt any bugs, just liek all microsoft products, and you can more likely get much more support from like Access97 <p>Karl<br><a href=mailto:kb244@bellsouth.net>kb244@bellsouth.net</a><br><a href= </a><br>Experienced in , or have messed with : VC++, Borland C++ Builder, VB-Dos, VB1 thru VB6, Delphi 3 pro, Borland C++ 3(DOS), Borland C++ 4.5, HTML, ASP(somewhat), QBasic(hehe, yea it was 4.5 too, least i didnt start with COBOL)
 
well, unfortunately, I don't have a choice. This company has upgraded to 2000, and thats what I have to work with. Does noone else use 2000? Is everyone still using 97?
 
allyeric,<br>
Try removing the reference (if there is one) to DAO library (probably 3.6). These conflict, and there have been several posts here about this, this 2000 version is looking like a repeat of the horrors of Access 95, let's hope this clears up with patches--soon. I strongly steer clients away from Access 2000, for these same fears.<br>
--Jim
 
Well your copany could switch back to Access97 if you could convince them that 2000 is gona cost them more of a hassle than just trying to adjust to it. Just cuz something is newer doesnt always make it better, and more error-free(they're probally thinking that tho) <p>Karl<br><a href=mailto:kb244@bellsouth.net>kb244@bellsouth.net</a><br><a href= </a><br>Experienced in , or have messed with : VC++, Borland C++ Builder, VB-Dos, VB1 thru VB6, Delphi 3 pro, Borland C++ 3(DOS), Borland C++ 4.5, HTML, ASP(somewhat), QBasic(hehe, yea it was 4.5 too, least i didnt start with COBOL)
 
It may be elementary to add but your might look at:<br>
<br>
&quot;<A HREF=" TARGET="_new"><br>
This told me what I needed to know to make VB6 and ACCESS2000 work for me....good luck....Dewey <p>Dewey Davis<br><a href=mailto:ddavis@dfn.com>ddavis@dfn.com</a><br><a href= > </a><br>
 
Hmm I looked at that ASP only to get a 404 error <p>Karl<br><a href=mailto:kb244@bellsouth.net>kb244@bellsouth.net</a><br><a href= </a><br>Experienced in , or have messed with : VC++, Borland C++ Builder, VB-Dos, VB1 thru VB6, Delphi 3 pro, Borland C++ 3(DOS), Borland C++ 4.5, HTML, ASP(somewhat), QBasic(hehe, yea it was 4.5 too, least i didnt start with COBOL)
 
First, I really want to thank everyone for their help. Secondly, what my main problem is with this, is I can't figure out the proper code to use to use ADO. Do I put the control on the form and use code? Or do I only use one of the other? Do I use DSN, non-DSN? Here is some of my code - that might make it easier to see how confused I am!<br>
<br>
Set Con = New ADODB.Connection<br>
Con.ConnectionString = "DSN=Training.dsn"<br>
Con.Open "DSN=Training.dsn", "", ""<br>
Set rs = New ADODB.Recordset<br>
<br>
strSQL = ("SELECT * FROM Exam_SRHEXA16 where Question_No =" & lQuestionNumber)<br>
<br>
For lQuestionNumber = 1 To 24<br>
<br>
rs.Open strSQL, Con<br>
While Not rs.EOF<br>
sAnswers(lQuestionNumber - 1) = rs("Answer_Text")<br>
sCorrectAns(lQuestionNumber - 1)=rs("Correct_Answer")<br>
sQuestion(lQuestionNumber - 1) = rs("Question_Text")<br>
rs.MoveNext<br>
Wend<br>
Next<br>
<br>

 
heres an ASP Code that gets access to an access database thru ADO, it should be very similar to VB<br>
<br>
SQL = &quot;SELECT * FROM Users where Email = '&quot; & Request.Item(&quot;TO&quot;) &&quot;' and Password = '&quot; & Request.Item(&quot;PASS&quot;) &&quot;'&quot;<br>
SET DOB = Server.CreateObject(&quot;ADODB.Connection&quot;)<br>
DOB.Open &quot;DSN=ldap;UID=;PWD=;&quot;<br>
SET oRs = DOB.Execute(SQL)<br>
<br>
if not oRs.EOF then<br>
...and so on<br>
<br>
<p>Karl<br><a href=mailto:kb244@bellsouth.net>kb244@bellsouth.net</a><br><a href= </a><br>Experienced in , or have messed with : VC++, Borland C++ Builder, VB-Dos, VB1 thru VB6, Delphi 3 pro, Borland C++ 3(DOS), Borland C++ 4.5, HTML, ASP(somewhat), QBasic(hehe, yea it was 4.5 too, least i didnt start with COBOL)
 
thanks Karl!!<br>
<br>
With a few minor adjustments, it works!!! thank you thank you thank you! <br>
<br>
<br>
<br>

 
lol, your welcome, you should see the post in the VC++ forum, i'm still in IRC chats with him, on nights, just helping him make tweaks to his ADO integration. <p>Karl<br><a href=mailto:kb244@bellsouth.net>kb244@bellsouth.net</a><br><a href= </a><br>Experienced in , or have messed with : VC++, Borland C++ Builder, VB-Dos, VB1 thru VB6, Delphi 3 pro, Borland C++ 3(DOS), Borland C++ 4.5, HTML, ASP(somewhat), QBasic(hehe, yea it was 4.5 too, least i didnt start with COBOL)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top