Solved

How to connect a MS Access database stored on server?

Posted on 2002-04-18
16
180 Views
Last Modified: 2011-08-18
I found a web site that allowed me to upload a MS Access database.  After upload it, that database will stored in db folder of the root directory.

my question is, how to use VB6 to connect to that database to update and retrieve record from database?
i have user name and password already.

what should i do?  please give me the coding on how to connect to the database.  thanks first.
0
Comment
Question by:yongyih
  • 9
  • 7
16 Comments
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 6950103
0
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 6950290
take some time to clean up your profile

Questions Asked 50
Last 10 Grades Given A A A A A A A A A A  
Question Grading Record 39 Answers Graded / 39 Answers Received
0
 
LVL 2

Author Comment

by:yongyih
ID: 6950720
link to too many areas.. please find out the code for me, thanks.

i will accept comment for questions soon. but some of them i didn't get any answer..how? delete it?

thanks first for find out the code for me.
0
Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

 
LVL 70

Accepted Solution

by:
Éric Moreau earned 100 total points
ID: 6950743
Dim oConn

Set oConn = Server.CreateObject("ADODB.Connection")

oConn.Open "Provider=MS Remote;" & _
                  "Remote Server=http://myServerName;" & _
                  "Remote Provider=Microsoft.Jet.OLEDB.4.0;" & _
                  "Data Source=\somepath\mydb.mdb;", _
                  "admin", ""
0
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 6950747
if some questions didn't get comments, you can delete them. for those with comments, you will need to ask CS (http://www.experts-exchange.com/jsp/qList.jsp?ta=commspt) to delete them.
0
 
LVL 2

Author Comment

by:yongyih
ID: 6952295
sorry, i forgot to mention that the VB6 program is run on client side.  That's mean the connection will establish on client side program.

After i copy paste your code, VB cannot find any Server object.

How to solve this problem?
0
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 6952308
>>sorry, i forgot to mention that the VB6 program is run on client side.  That's mean the connection will
establish on client side program.

No problem with this.

>>After i copy paste your code, VB cannot find any Server object.

??? Any error message? Are you sure of your Server name? Do you have suffisant privileges?
0
 
LVL 2

Author Comment

by:yongyih
ID: 6952900
error message... something like 'object required' and highlight this 'Set oConn = Server.CreateObject("ADODB.Connection")'

I think VB cannot find the 'Server' object.  What other reference do i need to add in to this project?  or i need to install other software?

thanks for reply.
0
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 6953243
use this instead:

Set oConn = CreateObject("ADODB.Connection")
0
 
LVL 2

Author Comment

by:yongyih
ID: 6954077
Private Sub Command1_Click()
Dim oConn As ADODB.Connection
Dim rec As ADODB.Recordset
'Set oConn = Server.CreateObject("ADODB.Connection")
Set oConn = CreateObject("ADODB.Connection")

oConn.Open "Provider=MS Remote;" & _
                 "Remote Server=http://www.brinkster.com;" & _
                 "Remote Provider=Microsoft.Jet.OLEDB.4.0;" & _
                 "Data Source=\db\test.mdb;", _
                 "username", "password"
Set rec = oConn.Execute("select * from test")
MsgBox rec.RecordCount
End Sub

this is my code.  i received an 'Internet Server' Error
why?
0
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 6954578
I doubt that you will be able to do it using Brinkster (at least using the general solution)!

You may store an Access database onto your account and you can have ASP pages stock into your accounts that use this database. But it does not seems that VB can access it remotely.

See an example of an ASP page that use a brinkster database at http://www.experts-exchange.com/questions/Q.20141477.html

0
 
LVL 2

Author Comment

by:yongyih
ID: 6955233
o.. cannot use VB to access it remotely... that's too bad.
how about VB.Net? ^_^

I don't know ASP.  Anyway, if you found out a way to access Access database remotely, don't forget to tell me. thanks.
0
 
LVL 2

Author Comment

by:yongyih
ID: 6955238
Cannot access Access database remotely is because of VB or brinkster web site?

please tell me, thanks.
0
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 6955894
Brinkster. I have sent an e-mail to their support and I am waiting for an answer (I will use this free 30meg storage if it works!).
0
 
LVL 2

Author Comment

by:yongyih
ID: 6957198
then, remember to tell me how to do it? hehe.. thanks.
0
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 6975924
I had this message from the Brinkster support:

We do not support vb, we support VB .NET. The only connection string we have available to give out is coded in asp. If you need further assistance, please post a message in the forums.
0

Featured Post

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question