Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  HOME    TRACKER    Visual Basic

How To Connect VB6.0 (Access Database) Using ODBC

Hello All,

I have to connect to an Access database , db1.mdb from my Visual Basic Code.I created a DSN for .mdb called "fms".When try to connect to this dsn from my code I am getting error.

Can anyone help me to sort out this.


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
ACCESS Using ODBC To Connect To The MYSQL Database
Hai all,
I need some help regarding this, 'creating voting system'.i have created login screen and database using seems i have to use 'lock' and 'unlock's to get concurrency.Please go through this,ACCESS using ODBC to connect to the MYSQL database.
           A voter must supply a correct user name (login) and password before being allowed to vote. A voter is only allowed to vote once. When a voter votes, his vote should be recorded in such a way that no one can determine the way a voter voted.
             program should be multiple user in that more than one person can vote at a time. Measures need to be taken to make sure the no. of votes counted is correct. To test program, it should be loaded on at least 2 different computers and both tested at the same time.Please help me for code..... Thankyou in advance

Connect To An Oracle Database Without Using ODBC?
Is there a way to connect to an Oracle database without using ODBC?


Connect To A Database Through An Odbc Data Source
i'm trying to access the user database defined in th dsn by using ADO, but i dont know how to reference the object models..
can anyone tell me??

Connect To A Progress Database Using An ODBC Connection Using VB 6

I would like to connect to a progress 9.1c database using a ODBC connection using a merant driver via VB6.

Can somebody please assist in my ever growing problem

VB/Access App Cant Connect To Odbc Dbase

I have a VB 6.0 app using access 2000 database. This app resynchs their laptops to the master database on a machine in their office.. They use when they leave the office to copy the dbase locally to the laptop and then point the odbc connection for the app to the copied database... c:... instead of s:..

They then use another vb app which writes to the dbase locally...

Upon return to the office they then resynch the master dbase on the machine in their office... Update with changes made while in the field....

All worked fine until VISTA... I had to install Office 2007 with access on two newly purchased laptops.( Another story)

I had everything running fine until Last week. I now get an error trying to run the "Go remote" utility

Microsoft[ODBC Microsoft Access Driver] 'Unknown' is not a valid path. Make sure the path name is spelled correctly and that you are connected to the server....

 I have googled and read alot and tried a lot of things.. rebooting all machines hasnt worked. Permissions havent changed since it was working ok.. If I try and debugg it in VStudio 2000 It works fine???? Any ideas??

Connect To MySql Via Access Error ODBC--call Failed
Hi i found a great tutorial ( on connecting to MySql via Access however i keep getting an ODBC--call failed error [MYSQL][ODBC 3.51]Driver User Cancelled. (#0). I downloaded and installed and followed the setup instructions. When i tested the connection it was successful, however i don't know the Port ans Socket, as it's a remote server the mySql database is on. Can anyone help me out?



Graph Report From MS Access Database Using ODBC
guys..can anyone teach me how to create a graph report in vb using ODBC? or can anyone send me a sample program of this.... Please... help me.. i badly need it for my thesis project. thanks!

Pasting Records To Access Database From ODBC
Hi all,

I need help please !

How can I return a recordset from an external database (via ODBC link) and paste it into an Access database table.

I have worked out how to retrieve a recordset ok and have even been able to create a table in Access through code. However, I can't seem to fill my table in Access with the data from the recordset retrieved using ODBC. Is this the problem. One recordset is ODBC and the other MSJet - I just dunno.

Its all getting very technical for me - I aint even a programmer !!!

If anyone needs further explanation then please mail me at.

Someone please help, I have a deadline that i need to meet.



Database Access Speed: Foxpro ODBC?

I have been working on a relatively easy project. .at least it seemed so.  I need to access a small number of records from a 54000 record table.  Bad news, the table is not ordered in any good way, so I have to "brute force" my search for my records.  I have tried several methods of access including ODBC data connections with SQL and data access objects.  The SQL works as long as i don't apply a WHERE.  The WHERE generates an divide by 0 error. Unfortuanatly, if the data is the cause there is nothing i can do about it. . .the data is "untouchable" per managements orders (yes i am opening it in read only mode!) Right now i have the program open the datasource with a data access object, do a movelast, then perform my work.  It is not too bad this way.  If i do it with the ODBC data connection and sql it takes about 3 minutes to open.  anyone have any advice on how to speed up this process?  Oh, one more thing.  The data is on a remote server connected by a high speed WAN.  Any ideas would be appreciated!

David Moore

Multi-user Access Database Using ODBC
hi everyone,
I need to create a Data Source using ODBC that will not create problems if my VB project is deployed on a different machine..That is it should be independent of the machine.Many users are going to be using the project at the same it will be a multi-user project as well..Is there any way to do this?Any help will be highly appreciated..If not ODBC then is there any other way using which I can make my VB project access the MS-Access database independent of its path???


How To Connect To An Access Database?

I have an access database (.mdb) and i'm trying to connect at it, haven't found a way to make it work

Does anyone know how to connect to an access database, how to get record and how to insert a record? (I know SQL language so you don't need to explain it =) I only need to know how to connect and create recorsets etc...)

Thanks alot

How To Connect Ms Access Database With....
Hi everyone

I have Ms Access database which is password protected. I want to connect this with data report using code.

Please what where i have to code.

Please help me

Waiting for reply.

Thanx in advance.

How To Connect From ASP.NET To An ACCESS Database?
Hi all,

I am trying to connect an ASP.NET application to a MS Access database using SQLConnection class. It is not working and I think it is only for use with SQL server.

Does anybody know how to connect to an Access db and can you explain what I should put in the connection String (my db file is mydb.mdb)?

Thnx in advance


Connect To Access 97 Database W/ VB3 Pro
Hi gang,
Is there anyway I can connect to a table created in the above version of Access? I'm trying to connect via the data control and it says that the database is corrupted or is not an Access database.
Any idea?
Thanks much

Cant Connect To Access Database
Hi all,
I am trying to connect my VB6.0 application to access database

programmatically but am not able to do so... i dont want to do it by usin

Datacontrol or adodc control but programmatically ....also i will be usin

this application in network .. so plz suggest me what to do..

Thanks in Advance

How To Connect My Database Access
i have computer A & B. in computer A i use be a server.
i have my vb program in computer A. i set my adodc connected to my access database using adodc.
in computer b i set my adodc to adodc in computer a but every i update data there a message error : operation must use an updatable query.
 what must ido?

How To Connect To A Web Database (Access)
I'm using VB5 and I'd like to know how to connect to an Access database on the web and be able to delete info from any tables.


How Can I Connect To My Access Database?
I have a database on my site on
Can I connect to the database with application on VB 6.0?

Thank you.

Connect To MS Access *.mdb Database
I’m writing a smart device application by VB.Net. But I’m new in VB.Net.

How can connect with my Ms Access *.mdb database in smart device application?


Connect To Access Database
How do I connect to an Access database and retrieve records from it with using the IIS 4.0. The Code is being written in Visual
Basic 6.0 No password is being used for now.

Connect To A Remote MS-ACCESS Database
I have an access database that has shipping information (invoice#, customer name, USPS tracking #). I created an ASP to query the database and that works fine. On the other hand, I have a VB application that updates the tracking information (along with some other data) into my accounting software.

The point is that I would like to modify the VB (VB 6) to also update the remote database with the last invoices shipped. I've spent about 2-3 hours trying to look for the proper ado connection string, but I'm not sure I found it. Can anybody point me in the right direction? Any help would be greatly appreciated.

So far, this is what I have:
I created a sample project that connects to the database using the ADO Data Control. I was able to open the database & table (Tracking) but I get an error when I use the .AddNew method.

Is this the best way of doing, should I deal with the error or is there a better way of doing it.

Connect To Access Database On The Internet
I wanted to ask why the following code keeps giving me an error:

'Get the records from the database
Dim rs As ADOR.Recordset
Set rs = New ADOR.Recordset

but I see that there are a number of posts at this site from people having the exact same problem, and no one seems able to answer the question why we can't connect to an Access database over the internet.

Is it impossible to do this??????

Can Anyone Tell Me How To Connect To Remote Access Database
i'm using vb6 , and access databse for database ,
i want to connect to remote access database on the server
but i don't know how, i think there is some setting in odbc or what?
here is the code i use
.Open "Provider=MS Remote;" & _
"Remote Server=http://info;" & _
"Remote Provider=MSDASQL;" & _
"DSN=ourdatabasenew6;" & _
"Uid=admin;" & _
is it correct?
or this is correct?
.ConnectionString = "Provider=MS Remote;Remote Server=http://myServerName;Remote Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:somepathmydb.mdb" '"admin", ""

i tried this 2 codes but didn't work , i think there is some problem in setting in odbc .
thank you

Trying To Connect To A Access Database With Password
I am trying to connect to acsess database with vb .net. Everthing works great until I protect the database with a password. And I am using the Data Adapter Configuration Wizard. I put the password and click at the Test connction button. This message appear:
"Unable to connect to database.
It is not possible to begin the application. Lack the file of information of the work group or it is open the exclusive way for other user."
By the way, the database is closed.

How Can I Connect To An ORACLE Database From Access?
I need to know how can I set up access to read an oracle database

Connect To Access Database Dynamically
Hello everyone

I want to be able to connect my VB6.0 program to my Access 2003 database dynamically but I cannot. I can hard code the .databasename and .recordsource properties of my data1 object in the property window but when I clear those 2 fields in the properties window and then go into the code and try to connect to my database using the App.path and then my database name (database in same folder as program) and then do my .recordsource as the table it will never load.
Does anyone know how to get this to work or can you not conenct dynamically to an Access 2003 database using code

How To Connect To Access Database With OLE Field
Hi all

i am new to programming and am trying to use visual basic 6 to connect to a access database with a OLE field, I can get the visual basic to connect and retrieve field information to all other fields bar the OLE field which I hold different pictures to each record, any help would be much appreciated


Connect MS Access 2007 Database To VB6
Dear All,

I tried to connect to Access 2007 database with Microsoft ActiveX Data Object 2.8 in VB6. But error 'unrecognized database format'.

How to connect?

Thanks in advance

Connect With Protected MS Access Database
Hi all,

How can I connect with MS Access Database protected with username and password.

When I try to do so an error occured,

Help needed


Connect To A Access Database On A Webserver???
Is there any way to connect to a Access database that is located on a webserver???

What I want to do is to run a Insert SQL statement against the Access database, but without having to download the database to the local computer and then run the SQL statement, and the upload the database again.....

I can make the program in ASP but prefer not because I want to make the interface in VB. Is there perhaps a way to send variables from VB to a ASP page and then let the ASP page do the actual update on the database??? I need to send a big text field (PM) in that case, can this perhaps be done with just using querystrings???


How To Connect Between Access 2000 Database And VB5 ?
When I am trying to connect between a database of Access 2000 and VB5, I get the error: "unrecognized access/database format"

What to do?

How To Connect Remote Access Database Through Vb
Dear All

How to connect remote ms access database through vb,

thanks in advance

Bhadresh Sangoi
Cell : +91-9892638621
I'm careful not to confuse excellence with perfection.
Excellence, I can reach for; perfection is God's business

How To Connect To A Remote MS-Access Database?
hi friends

i am desiging one applciation in that i need to connect to my company website server in that i will have a MS-Access table.

i have created one DSN for this table in the web server (DSN=STBDSN).

think that i have a website called in that i have DSN called STBDSN this DSN points to the MS-Access file in the server.

so from VB how can i connect to that DSN..

please help for this

thanks in advance.


How To Connect To Remote Access Database Using Vb
hi friends

    how to connect to a remote MSaccess database using vb6.0.

i m having Msaccess database in the remote server i want to connect to the database and need to do operations like create edit and delete and view the recirds.
plz give as a possibilities to connect to a remote server

if u have a sample it will be better.


How Can I Connect A Access Database With Password
I use MS ADO Data Control 6 (OLEDB), I define connectionstring and enter password, but when I want to test connection, I get below message
Test Connection Failed, because of an error in initializing Provider, Can't Start your application , The workgroup information file is missing or open exclusivly by another user
Please help

Failing To Connect With Access Database
The following code:
accessDB = App.Path & "CCCDDatabase.mdb"
pasword = "mypassword"
myDSN = "PROVIDER=Microsoft.Jet.OLEDB.4.0;"
myDSN = myDSN & "DATA SOURCE=" & pathstring & ";"
' the security modification
myDSN = myDSN & "Password=" & password & ";"

was working fine and connecting with the database without problems before I add a password to the database and add the security line to the code

am I adding the password incorrectly?

The error message that shows upon execution says:
Cannot start your application. The workgroup information file is missing or opened exclusively by another user.

While the database is not opened by another user..!!

What could be the possibilties,
the error message is attached

If you haven't the one you love, love the one you have

Edited by - izz on 1/18/2002 10:11:20 AM

Connect Access DB Which Has Database Password
i posted earlier also, but nobody replied
So i am posting it again...
I want to create Database password by openeing 'DB exclusively' for Access Database[that is the only way to set database password in access]. so that others can not manipulate tables.
Then i want to pass that password in ADODB Connection String. I tried but failed. i want help in this problem.
i tried the below one, but not working
dbCCP.CursorLocation = adUseClient
dbCCP.Open "Provider=Microsoft.Jet.OLEDB.3.51;" _
            & " Data Source=\Vol2UsersSreddyPayments.mdb;" _
            & " User Id=admin;Password=pass;"

How to create DB passoword and pass it in connection string with out creating userGroup?
that is my question?

Access To An Oracle Database Via ODBC With A COM-Object Service Ordered By An ASP
For my diploma theses I am developing a client-server Application.
With the server component (COM) - developed in VC++ -I access to an Oracle database via ODBC.

OS =Win2000

When the client is a VBScript-File or a C++ application there is no problem.

But now I want to order Services from my server component via an Active Server Page (ASP).

The server comonent terminates irregularly without jumping in the catch block. With an error trace I have located the termination while instancing the database object with:

„CDatabase::Openex("DSN=BeUserPr Oracle;PWD=musterpwd;UID=musteruid",

Is it perhaps an ODBC Driver problem (I am using the newest Oracle ODBC driver!!!)

Who knows a solution for my Problem?


Connect To Password-protected MS Access Database
Dear Friends

I Am the beginner-programmer, working in Vietnam (Small country in South-east Asia)

I have the following problem:

We have the web-page, using ASP, to retreive data from a Access Database (not password protected).

We are also work within a group, each user has their own password to log-in to the database.

Now we try to set the password for the database, but then, the ASP does'nt work.

The code I use is:

Set conn = Server.CreateObject("ADODB.Connection") "MyDB","username","password"
sql = "SELECT * FROM MyTable"
Set rs = Server.CreateObject("ADODB.Recordset")
rs.Open sql, conn, 3, 3
reponse.write "Result: " & rs.fields("Filed_Number_1")

The server return the message of "Not correct username or password" when the password is set. It we do not set the password. it runs OK.

Can you - experts, to help me on that

Thanks a lot


How To Connect To An Access Database Stored On Internet
Hello friends,

i need some help from you. I want to know how can we connect
to an access database store online and run a query on that database.

Consider the following VB code i use to connect to a local database
having name jrem.mdb in the same directory as the exe file.

Dim dbsjreminder As Database
Dim insQuery As String
Dim intRecAffected As Integer

Set dbsjreminder = OpenDatabase("jrem.mdb", True, False, "MS Access;pwd=7tank5stomp")
insQuery = "INSERT into Users (username,password) VALUES ('testnet','netpass');"

dbsjreminder.Execute insQuery, dbFailOnError
intRecAffected = dbsjreminder.RecordsAffected

If intRecAffected = 1 Then
MsgBox "User added to the list", vbOKOnly, "Added"
End If
********************************************************************** **8

What i want to know is how can i connect to the same database if i have the
jrem.mdb file over the internet.

i checked it using the following code to open the database

Set dbsjreminder = OpenDatabase("", True, False, "MS Access;pwd=7tank5stomp")

but it gives an error

Error 3044
"c:my documents
ettest" is not a valid path

please help me how i can connect to the database stored online and run some sql query over that application.
also note that i want to do it in an application itself without the browser being involved.
i want to do it from a VB application itself.

please do let me know as it is urgent.

thank you very much.

How Do I Connect To A Password Protected Access Database?
Hi Every one,
I ve created an application using VB 6.0 SP 5 and using backend as ACCESS XP. It is working all fine. I m using Jet Engine 4 to connect. Now I want to upgrade my database. I made it password protected. After that i have set the same password in my ADODC controls and changed the connection string property. But still it is not able to access the database. It gives some Data link error. If any one has experienced such kind of problems before then please do help me.

Thanks A Lot...


How To Connect Remote System Using MS Access DataBase

How to connect remote system using MS Access DataBase.

I used this connection string ,

conn = "Provider=MS Remote;Remote Server=;Remote Provider=Microsoft.Jet.OLEDB.4.0;Data Source=Inmacs.mdb;Persist Security Info=False"

conn is opening , but in login screen when i click login button i am getting this error "Can't Connect to Server"


Connect To MS Access Database On Remote Computer

I'm trying to connect MS Access database which is on the Remote Computer.

I've written this code. While opening connection ("No Error") but if I try to select or insert records ("Run-time error '4100' Business object cannot be created.)

Plz suggest :-

VB Code:
Dim MyConn As ADODB.Connection    Set MyConn = New ADODB.Connection     MyConn.Open "Provider=MS Remote;" & _                "Remote Server=server;" & _                "Remote Provider=Microsoft.Jet.OLEDB.4.0;" & _                "Data Source=" & App.Path & "StatusReport.mdb;" & _                "Persist Security Info=False"        MyConn.CursorLocation = adUseClient     MsgBox "Connectin OK"    SQL = "Insert Into Testing(abc) Values('Manoj')"    MyConn.Execute SQL                                        'ERROR HERE    MsgBox "Insertion OK"


"File Name=MyFileName;"

VB Code:
MyConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _                "File Name=MyFile;" & _                "Remote Provider=Microsoft.Jet.OLEDB.4.0;" & _                "Remote Server=\server;" & _                "Data Source=& App.Path & " StatusReport.mdb;" & _                "Persist Security Info=False"

I don't know how to get it done. Plz suggest a solution.

Thanks & Regards

How To Use MS-Access Connect SQL7 Database Server
How to use MS-Access connect SQL7 database . tks

How To Connect Remote System Using MS Access DataBase

  How to connect remote system using MS Access DataBase.

 I used this connection string ,

    conn = "Provider=MS Remote;Remote Server=;Remote Provider=Microsoft.Jet.OLEDB.4.0;Data Source=Inmacs.mdb;Persist Security Info=False"

conn is opening , but in login screen when i click login button i am getting this error "Can't Connect to Server"


Please do not double post:PROBLEM:
You posted the same question at view topic #144723
Please read the: Posting Guidelines Item 2.
It won't increase but rather decrease your chance to get help.
If you make a mistake with your post, you can always edit it!

Edited by - rock on 5/9/2007 1:57:06 AM

How To Connect MS Access Database With Report Using Code
Hi everyone

I have Ms Access database which is password protected. I want to connect this with data report using code.

Please what where i have to code.

Please help me

Waiting for reply.

Thanx in advance.

How To Connect Remote System Using MS Access DataBase

  How to connect remote system using MS Access DataBase.

 I used this connection string ,

    conn = "Provider=MS Remote;Remote Server=;Remote Provider=Microsoft.Jet.OLEDB.4.0;Data Source=Inmacs.mdb;Persist Security Info=False"

conn is opening , but in login screen when i click login button i am getting this error "Can't Connect to Server"


Can't Connect To Access Database When I Used Data With Password
I set connection with ADODB.Connection
Dim Con As ADODB.Connection
Set Con = New ADODB.Connection
Con.Provider = "Microsoft.Jet.OLEDB.4.0"
Con.Open "datapathDataBaseName.mdb", UserName, Password
when i run the program, and then show up an error:
Run-time error '-2147217843 (80040e4d)':

Cannot start your application. The workgroup information file is missing or opened exclusively by another user.
what's wrong with my program or database?

Would anybody help me?


How To Connect A Access Report To A SQL Database Without Using Linked Tables
Hi Guys

I have to convert a Access database to connection to SQL directly without using Linked tables.

I have managed to create recordsets that connect to SQL and retrieve the data I want.

I then reference the results in the RecordSource field of the report but the report is defaulting to the access database to fetch the stored proc. How do I refer the report to the SQL database.

Please, any help would be appreciated.


Copyright 2005-08, All rights reserved