Question

ADO MS Access connection over internet VB6

Asked by: beicnet

Hi Experts,

Can anybody give me a working example for data access over internet using ADO through VB6 application?

1. Connection to a remote machine
2. Reading and Writing data from/to database
3. Data Source (ODBC) configuration if needed, etc...

I'm using custom web server:
http://www.pablosoftwaresolutions.com/html/quick__n_easy_web_server.html
Not Microsoft's IIS!

I found over internet a bunch of codes/examples but unfortunately they not working!

I have some code but it gives me an run-time error '8209', Internet Server Error: Object/Module not found. on line ".Open strSQL, adoConn, , , adCmdText"

But I have all references included in my project... :(

Please help me, it's very important!!!

Best regards,
Viktor

Option Explicit
Dim adoConn As ADODB.Connection
Dim adoRst As ADODB.Recordset
 
 
 
Private Sub Command1_Click()
 
 Dim strSQL As String
 Dim strConString As String
 
 
 strConString = "Provider=MS Remote;" & _
                "Remote Server=http://192.168.0.1;" & _
                "Remote Provider=Microsoft.Jet.OLEDB.4.0;" & _
                "Data Source=PosMAX" 'Using ODBC (database name: PosMAX.mdb, no password protection)
 
 
 Set adoConn = New ADODB.Connection
 
 
 adoConn.Open strConString, "", ""
 
 
 strSQL = "Select * from AppClients"
 
 
 Set adoRst = New ADODB.Recordset
 
 
 With adoRst
  .Open strSQL, adoConn, , , adCmdText
 
 
  If Not .EOF Then
   Do While Not .EOF
    List1.AddItem adoRst(0) & vbTab & adoRst(1)
    .MoveNext
   Loop
   .Close
  End If
 
  
 End With
 
 
End Sub

                                  
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:

Select allOpen in new window

This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.

Subscribe now for full access to Experts Exchange and get

Instant Access to this Solution

  • Plus...
  • 30 Day FREE access, no risk, no obligation
  • Collaborate with the world's top tech experts
  • Unlimited access to our exclusive solution database
  • Never be left without tech help again

Subscribe Now

Asked On
2009-08-15 at 02:15:34ID24654949
Tags

Microsoft Visual Basic 6

,

ADO

,

Remote Data Connection

,

MS Access

Topics

Microsoft Access Database

,

Visual Basic Programming

Participating Experts
2
Points
500
Comments
34

Trusted by hundreds of thousands everyday for fast, accurate and reliable tech support.

  • "The time we save is the biggest benefit of Experts Exchange to Warner Bros. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange." Mike Kapnisakis, Warner Bros.
  • "Our team likes having a resource that is more secure than just using Google and most experts using this service really know their stuff. It's nice to look here first versus using Google." Dayna Sellner, Lockheed Martin
  • "Anytime that I've been stumped with a problem, 9 out of 10 times Experts Exchange has either the accepted solution or an open discussion of the potential solution to the problem." Kenny Red, eBay Inc.

See what Experts Exchange can do for you.

Got a question?

We've got the answer.

Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.

Screenshot of Experts Exchange Knowledgebase

Need individual assistance?

Our experts are ready to help.

If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.

Screenshot of Experts Exchange Knowledgebase

Want to learn from the best?

Read articles from industry experts.

Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.

Screenshot of an Article

Working on a long term project?

Store your work and research.

Save solutions to your questions, answers you’ve discovered through searching plus helpful articles in your personal knowledgebase for easy future access.

Screenshot of Experts Exchange Knowledgebase

Access the answers to your technology questions today.

Subscribe Now

30-day free trial. Register in 60 seconds.

What Makes Experts Exchange Unique?

Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Trusted by the world's most respected brands.

image of each brand's logo

Faithfully serving IT professionals since 1996.

Experts Exchange Logo

Try it out and discover for yourself.

Subscribe Now

30-day free trial. Register in 60 seconds.

Related Solutions

  1. ADO
    how do i use ADO in VB to access SQL Server? i'm using ADO version 2.0, SQL SERVER 6.5, VB 5.0.
  2. ADO and VB6
    I am looking at buying VB6 to connect to a SQL Database. Will this be as easy as the ODBC Access connection. And will it be faster than using ODBC.
  3. ADO and VB6 Installation
    Is there a one stop way to install a VB6 program and ADO on Win95/98 and NT4. At the moment it is a three stage affair - dcom98 - mdactyp - myprogram - relying on the end user's patience and it looks very unprofessional. If I had a list of which goes where I could use my Wis...
  4. VB6 + ADO + MYSQL
    How can I connect MySQL using ADO in VB6? Have I to use ODBC or I can use OLE-DB?
  5. Best ODBC driver for VB6 and Oracle 8 (ADO)
    Someone has said that we may not have an optimal ODBC driver for Oracle 8 using VB6 on Windows NT SP4. Does anyone have an idea for the most suitable (read fast) driver for interfacing our VB6 app to an Oracle8 database. We are using ADO in the application.
  6. ADO programming in VB6
    I am converting a VB6 (Service Pack 5) project to ADO. despite having several books and VBPJ issues since 1996 I cannot find information on certain BASIC aspects like how to bind a Grid (Videosoft FlexGrid 7) to an ADO Data Control in code. I do not want to 'hard code' the C...

Free Tech Articles

  1. WARNING: 5 Reasons why you should NEVER fix a computer for free.
    It is in our nature to love the puzzle. We are obsessed. The lot of us. We love puzzles. We love the challenge. We thrive on finding the answer. We hate disarray. It bothers us deep in our soul. W...
  2. SCCM OSD Basic troubleshooting
    SCCM 2007 OSD is a fantastic way to deploy operating systems, however, like most things SCCM issues can sometimes be difficult to resolve due to the sheer volume of logs to sift through and the dispe...
  3. Migrate Small Business Server 2003 to Exchange 2010 and Windows 2008 R2
    This guide is intended to provide step by step instructions on how to migrate from Small Business Server 2003 to Windows 2008 R2 with Exchange 2010. For this migration to work you will need the fo...
  4. Create a Win7 Gadget
    This article shows you how to create a simple "Gadget" -- a sort of mini-application supported by Windows 7 and Vista. Gadgets can be dropped anywhere on the desktop to provide instant information, ...
  5. Outlook continually prompting for username and password
    There have been a lot of questions recently regarding Outlook prompting for a username and password whilst using Exchange 2007. There are a few reasons why this would happen and I will try to cover t...
  6. Backup Exchange 2010 Information Store using Windows Backup
    There seems to be quite a lot of confusion around the ability to backup Exchange 2010 using the built in Windows Backup feature. This stems from the omission of this feature prior to Exchange 2007 s...

Cloud Class Webinars

  1. Avoiding Bugs in Microsoft Access
    Alison Balter takes and in-depth look at avoiding bugs in Access. In this webinar you will learn about using the immediate window to debug your applications, invoking the debugger, using breakpoints to troubleshoot, stepping through code, setting the next statement to execute, ...
  2. Top 10 Best New Features in Visio 2010
    Scott Helmers gives live demonstrations of the top 10 new features in Visio 2010. This webinar will teach you how to create compelling diagrams by adding shapes to the page with a single click, linking the shapes in a diagram to data in Excel (or SQL Server, or SharePoint), ...
  3. IT Consultant Business Secrets Revealed
    Michael Munger, Experts Exchange tech pro and IT consultant, pulls back the curtain on his very successful businesses and answers question on every IT consultant and business owner should know about. He shares secrets on what he did to solve the 5 most common problems in IT, ...
  4. Disaster Recovery and Business Continuity
    Quest CTO, Mike Billon, gives an overview of the steps involved in building a dunamic disaster recovery plan. Through case studies and an examination of software/hardware tooles for monitoring and testing, you'll gain a better understandin of where you are, where you want ...
  5. Organize Your Visio Diagrams with Containers and Lists
    Scott Helmers uses cross functional flowcharts, wireframe diagrams, data graphic legends and seating charts to teach you: how to ustilize all three new structured diagram components in Visio 2010, the best practices for organizeing shapes in previous version of Visio, how to organize ...
  6. How to Us Objects, Properties, Events and Methods in Microsoft Access
    Alison Dalter gives an in-depbth look at objects, properties, events and methods in Microsoft Access. In this webinar you will learn about using the object browser, referring to objects, working with properties and methods, working with object variables, understanding the ...

Join the Community

Give a Little. Get a Lot.

Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.

Join the Community

Answers

 

by: cactus_dataPosted on 2009-08-15 at 02:57:31ID: 25104714

You can't do this. An Access MDB is to be connected via a LAN or locally, not via HTTP.

/gustav

 

by: beicnetPosted on 2009-08-15 at 04:41:37ID: 25105033

Just to be clear to all what a trying to do:

I have created a small Ms Access 2000 DB in one machine and I want to access and update this DB from another machine over the internet. I want to use ODBC connection with DSN/ADO.

My machine will access this DB through a VB program to update/add/modify/view and so on. It's sort of like a client/server application.

How can I do this in the simplest way?

Can you please help me,

Viktor

 

by: BadotzPosted on 2009-08-15 at 08:49:03ID: 25105810

The connection string can locate the DB, there is no reason to add complexity by trying to connect over the internet.

What possible reason could there be for you to need to connect over the internet?

 

by: cactus_dataPosted on 2009-08-15 at 10:19:06ID: 25106134

> please explain me this posts bellow
These posts recommend to create a web service to reach the data. That is a possible option not related to neither an ODBC nor ADO remote connection.

> sort of like a client/server application.
No. An Access MDB file is just a file.

> How can I do this in the simplest way?
Either build a web service as suggested in the links, or - as you are familiar with ODBC - move the database to a database server engine like MySQL or SQL Server Express (both free to obtain and use). These are easily reached via the Internet.

/gustav

 

by: beicnetPosted on 2009-08-15 at 10:54:08ID: 25106251

To Badotz:

I wish to make a little project like http://uptime-project.net/ was, to send and receive a small amount of data, (OS Version, OS Uptime, CPU type, etc...) for collectiong, analyzing bug reporting.

To mention I can do this over ASP to pass data between MS Access database and my VB6 application but then I must to load, auto-fill forms in hidden IE control in my app, etc...

I thought that it must be an easiest way to do this trough IIS and MDB, Am I correct?!

Sorry for my bad English! :-)

Thank you in advance,
Viktor

P.S. Can anybody provide me a little VB6 project (Read, Write to MS Access database trough internet)?

 

by: BadotzPosted on 2009-08-15 at 10:57:17ID: 25106265

>>I thought that it must be an easiest way to do this trough IIS and MDB, Am I correct?!

That would not be my approach.

VB6 can connect directly to an .MDB file. *That* would be the simplest approach (provided the .MDB file is available on some common ground, i.e. a shared server, etc.).

 

by: cactus_dataPosted on 2009-08-15 at 11:04:57ID: 25106294

You may not like it, but as I wrote:

> An Access MDB is to be connected via a LAN or locally, not via HTTP.

As you seem to have the file available locally:

http://192.168.0.1

just establish a net share (network drive or network connection) to that machine and you are done. No IIS, no ODBC, just a linked mdb.

/gustav


 

by: beicnetPosted on 2009-08-15 at 11:05:18ID: 25106295

To Badotz:

Yes I know that the "VB6 can connect directly to an .MDB file", I'm using ADO and DAO a few years now but I always developing applications for local usage or over the network (LAN) thats working like a charm!

But not over internet!

Can you give me some kind of snippet, sample, source for that!

Best regards,
Viktor

 

by: BadotzPosted on 2009-08-15 at 11:21:33ID: 25106351

>>Can you give me some kind of snippet, sample, source for that!

Nope. It isn't a scenario I would even consider.

 

by: beicnetPosted on 2009-08-15 at 11:42:49ID: 25106419

To cactus_data:

"just establish a net share (network drive or network connection) to that machine and you are done. No IIS, no ODBC, just a linked mdb."

Yes I know that, but then every client will see my MS Access database file and I can not go each of them to set up the network drive, thats is the reason to connect database over internet with VB6 app...!

Client app.========internet=========Server (database)

 

by: cactus_dataPosted on 2009-08-15 at 11:52:14ID: 25106448

To repeat myself:

Either build a web service as suggested in the links, or - as you are familiar with ODBC - move the database to a database server engine like MySQL or SQL Server Express (both free to obtain and use). These are easily reached via the Internet.

/gustav

 

by: beicnetPosted on 2009-08-15 at 11:57:16ID: 25106465

To Badotz:

"Nope. It isn't a scenario I would even consider."

Ok, then what is your scenario for consideration?!$ :-)

Best regards,
Viktor

 

by: BadotzPosted on 2009-08-15 at 12:50:27ID: 25106647

 

by: beicnetPosted on 2009-08-22 at 03:25:26ID: 25158125

To Badotz:

"VB6 can connect directly to an .MDB file. *That* would be the simplest approach (provided the .MDB file is available on some common ground, i.e. a shared server, etc.)"

Then can you give me some example or direction?!

Best regards,
Viktor

 

by: BadotzPosted on 2009-08-22 at 06:33:04ID: 25158633

I abandoned VB6 years ago, but I seem to remember it had database capabilities built-in. At least it could connect to Access via ADODB and a connection string.

You said

>>
Yes I know that, but then every client will see my MS Access database file and I can not go each of them to set up the network drive, thats is the reason to connect database over internet with VB6 app...!

When you say "client" do you mean computers not physically present at your site, like remote users? If so, then an internet solution might make sense. Please clarify:

Q. Are all of the computers using this app on the same network?
A. (your response)

Q. Will some of the computers using this app not have access to your network?
A. (your response)

 

by: beicnetPosted on 2009-08-22 at 09:35:12ID: 25159251

To Badotz:

Thank you for your quick response!!! :)

Q. Are all of the computers using this app on the same network?
A. Yes (but without ODBC, using direct connection to MS Access database file)

Q. Will some of the computers using this app not have access to your network?
A. Yes

About the project (in more details...):
 
1. The Web server and the Access database are on the same machine and on the same private network!

2. As for the Web server, I'm using this one  (fully compatible with ASP): http://www.pablosoftwaresolutions.com/html/quick__n_easy_web_server.html not Microsoft's IIS.
 
3. So, now I'm gonna let you know how I want my project to work:
 
In order for you to understand what I want the most easiest way: take it as if it was a little addresse book (database with names, addresses, cities, phone numbers, etc.), located on my Web server in MS Access database, but if I, for an example, travel away and I'm not around my local network, I want to be able to connect through my VB6 application to this database over the internet and to read, write, update and delete some data from it.


Best regards,
Viktor

 

by: BadotzPosted on 2009-08-22 at 10:04:23ID: 25159370

A web application must do all of the CRUD on the server, so you will have to use ASP (I use JavaScript on the server) or Asp.Net or PHP or Perl or some other server-side language.

Since there *can* be a client piece to this puzzle, you may not need your VB6 app for this, just a browser. (BTW: this is how I would do it).

A web service exposes public methods, and you can interact with it; this might be your approach.

 

by: beicnetPosted on 2009-08-22 at 10:37:39ID: 25159513

To Badotz:

Yes, I know that I can build it all with ASP, but it's very heavy and hard to make it in ASP, grid or listview, checkbox, combobox controls, etc...

Is there any chance to connect VB6 application directly to MS Access 2000 database through internet?!

Best regards,
Viktor

 

by: BadotzPosted on 2009-08-22 at 12:09:53ID: 25159830

Probably, but it just seems too awkward (in my mind, anyhow). And that's about all I have to say about that.

If you want more people to respond, click the "Request Attention" link in your original post and ask a moderator for assistance.

 

by: cactus_dataPosted on 2009-08-22 at 13:20:14ID: 25160082

> Is there any chance to connect VB6 application directly
> to MS Access 2000 database through internet?!

Not in a reliable way, and this answer does not change even if you ask three or four times.
Please read the previous postings from the first one for the reason behind this and your alternatives.

/gustav

 

by: beicnetPosted on 2009-08-22 at 23:50:55ID: 25161582

To all:

I can not believe that there is no way to do this!?

Then what about Remote Data Objects (RDO), I know that it is old stuf?!

Best regards,
Viktor

 

by: BadotzPosted on 2009-08-23 at 00:15:21ID: 25161611

It is not that there is no *way* to do it, it is that there is no *reason* to do it.

 

by: cactus_dataPosted on 2009-08-23 at 00:53:35ID: 25161704

> I can not believe that there is no way to do this!?

> It is not that there is no *way* to do it, it is that there is no *reason* to do it.

Well, I could find some reason ... still, that doesn't change facts or make your wish come true.
Use the alternatives as described.

/gustav

 

by: beicnetPosted on 2009-09-09 at 11:01:01ID: 25293905

I found a solution, NetDrive application! :-)

 

by: cactus_dataPosted on 2009-09-09 at 13:34:49ID: 25295286

NetDrive is neat - I have it running myself - however it is nothing more than a wrapped FTP transfer, which means that it will read or write the full database file. Thus, if you update or append just one record in a table, the full database file will be uploaded. This will only be useful in some very special cases. So be careful.

/gustav

 

by: beicnetPosted on 2009-09-09 at 22:59:42ID: 25297656

That is not good then, any help, I trying to do this over 4 months and nothing!

I can not find solution or any example to do this, I'm very sad right now! :-(

Regards,
Viktor

 

by: cactus_dataPosted on 2009-09-10 at 00:46:53ID: 25298040

Well, resign and use the alternatives as described.

/gustav

 

by: beicnetPosted on 2009-09-10 at 01:06:10ID: 25298136

Unfortunately I do not see any alternatives just a dry answers and it's going around and around!

I need some example code to direct access connection over internet, I do not want to use any ASP or PHP with MySQL, just a VB6 app., access database and a web server nothing else!

But I can not see any of these here or as alternatives!

I seeking for some clear code or less a code snipplet!

Best regards,
Viktor

 

by: cactus_dataPosted on 2009-09-10 at 01:35:02ID: 25298301

Start reading form comment no.1 (by me).
Then resign and rethink the alternatives. That is what everyone else has to do.

After reading the messages sequentially you will have reached this message and the circle is broken.

/gustav

 

by: beicnetPosted on 2009-09-10 at 04:53:17ID: 25299250

I found a solution!!!! :-) And it's working!!! The article below helped me out!
http://www.experts-exchange.com/Programming/Languages/Visual_Basic/VB_DB/Q_23458965.html?sfQueryTermInfo=1+mysql+vb6#a21784869

Converted MS Access database to MySQL and it's working trough internet from my vb6 app.!

Now I am very happy!!! :-)

Tank you for your time!

Best regards,
Viktor

 

by: cactus_dataPosted on 2009-09-10 at 05:00:45ID: 25299293

Thank you for choosing one of the suggested alternatives:

> How can I do this in the simplest way?
.. as you are familiar with ODBC - move the database to a database server engine like MySQL ..

/gustav

 

by: beicnetPosted on 2009-09-10 at 06:48:04ID: 25300141

I do not understand this:

"move the database to a database server engine like MySQL"

Why, already working like a charm!?

Regards,
Viktor

 

by: BadotzPosted on 2009-09-10 at 06:53:32ID: 25300215

All cactus_data is saying is that what you "discovered" had already been mentioned in his post http:#a25106134 (the 5th reply to your question).

20120131-EE-VQP-002

3 Ways to Join

30-Day Free Trial

The Experts

98% positive feedback on 31,087 answers since March 2000. angeliii is a Microsoft Most Valuable Professional for his work with MS SQL Server & Develoment.

He has also proven his knowledge of Visual Basic Programming, PHP Scripting and Oracle Databases.

The Experts

97% positive feedback on 10,752 answers since July 2000. lrmoore has more than 18 years experience in the networking industry.

The six-time Mircosoft MVPs specialties include firewalls, virtual private networking, and network management.

Testimonials

"...and excellent source for support... Kind of like having your very own IT dept." Electriciansnet

Testimonials

"I was apprehensive at signing up at first. However... it has already made my life as an IT administrator much easier." JaCrews

Testimonials

"WOW! You guys have great, active, and knowledgeable people on here." moore50

Business Clients

Business Clients

In the Press

"If you’ve got a question... Experts Exchange can supply an answer.”

In the Press

"...an invaluable aid for both IT professionals and those who require tech support."

In the Press

"where IT professionals provide quick answers on just about any topic"

Business Account Plans

Loading Advertisement...