Solved

How to connect a MS Access database stored on server?

Posted on 2002-04-18
16
182 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

680 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