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

MSDN FILES FOR ACCESS DB

Status
Not open for further replies.

hubud

Instructor
Oct 18, 2002
123
GB
I HAVE BEEN TRYING TO LINK FROM VB6 TO AN ACCESS DB AND WHEN I ENTER THE RECORDSOURCE AS THE DB I WANT IT STATES THAT THIS SOURCE IS NOT RECOGNISED. HELP STATES THAT THE MSDN NEEDS TO BE REINSTALLED.
I HAVE RUN THE .EXE FOR CD 1 HOWEVER THE PROBLEM STILLS PERSISTS.
ANY IDEAS? BEING NEW TO THIS I AM WONDERING IF I NEED TO INSTALL TO A PARTICULAR DRIVE OR LOCATION. THE VB IS LOCATED ON F DRIVE AND IS CALLED FROM THE C PARTITION.

 
Hello,

let me try to help you on what i can.
So, you want to open a database(access one ) from your VB6 project.
Ok, just do it like this:
When you load the form you must define the database you're using:
Data1.DatabaseName = App.Path & "\abc.mdb"(for example)
Data1.RecordSource = "select * from table_i_want"
Then just use when you want:

With Data1
.Recordset.MoveFirst
'first register

Do Until .Recordset.EOF
If (.Recordset.Fields("Field_i_need") = Text1.Text) And (.Recordset.Fields("Another_field_i_need") = Text2.Text) Then
'all correct
Unload Me
Form2.Show
Exit Sub
Else
.Recordset.MoveNext
End If
Loop
...

Hope this helps
Good luck
===================
* Marta Oliveira *
===================
marta100@aeiou.pt
-------------------
IndraCPC
-------------------
Portugal
===================
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top