Web Development

General discussion


Microsoft Access XP and Visual Basic 6

By grouchyone ·
I have several Microsoft Access XP tables (databases) that I want to use in Microsoft Visual Basic 6.0. How do I do this? Is there a converter/importer for this purpose? I'm a retired (DOS) computer programmer and I'm trying to learn Visual Basic 6.0 or should I be trying to learn Visual Basic.NET if VB.NET has this converter/importer?

Thanks for any help anyone can provide.

This conversation is currently closed to new comments.

Thread display: Collapse - | Expand +

All Comments

Collapse -

by Miss Kitty In reply to Microsoft Access XP and V ...

You need to update your mdac to the latest version (that's your data access control) and update VB 6.0 to the latest service pack. Below is an example of the code that you can use to open the databases:
Dim objConn As New ADODB.Connection
Dim objCmd As New ADODB.Command
Dim objRS As New ADODB.Recordset
Dim objParam As ADODB.Parameter
Dim count As Integer

'set up the database pointer
objConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Persist Security Info=False;Data Source=E:\ACCESS\CONTRACT HAULERS\HAULER.mdb;User ID=ADMIN"
objRS.CursorType = adOpenDynamic
objRS.LockType = adLockOptimistic

'setting the Active Connection for the command object
objCmd.ActiveConnection = objConn

'Providing the query name as commandtext
objCmd.CommandText = "[DELETE TTICKET QUERY]"
objCmd.CommandType = adCmdStoredProc

'Set the recordset to the command object result
Set objRS = objCmd.Execute
We still do alot in a dos environment.

Good Luck

Collapse -

by bmacarthur In reply to Microsoft Access XP and V ...

As a beginning VB programmer, you may want to check out the following sites; they have hundreds of examples showing connectivity between VB and MS products:


The following are forums where you can get more specific help:

You may also wish to run a query in Google Groups.

Related Discussions

Related Forums