Solved

How to connect a MS Access database stored on server?

Posted on 2002-04-18
16
178 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 69

Expert Comment

by:Éric Moreau
Comment Utility
0
 
LVL 69

Expert Comment

by:Éric Moreau
Comment Utility
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
Comment Utility
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
 
LVL 69

Accepted Solution

by:
Éric Moreau earned 100 total points
Comment Utility
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 69

Expert Comment

by:Éric Moreau
Comment Utility
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
Comment Utility
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 69

Expert Comment

by:Éric Moreau
Comment Utility
>>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
Comment Utility
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
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 
LVL 69

Expert Comment

by:Éric Moreau
Comment Utility
use this instead:

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

Author Comment

by:yongyih
Comment Utility
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 69

Expert Comment

by:Éric Moreau
Comment Utility
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
Comment Utility
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
Comment Utility
Cannot access Access database remotely is because of VB or brinkster web site?

please tell me, thanks.
0
 
LVL 69

Expert Comment

by:Éric Moreau
Comment Utility
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
Comment Utility
then, remember to tell me how to do it? hehe.. thanks.
0
 
LVL 69

Expert Comment

by:Éric Moreau
Comment Utility
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
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…
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…
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…

763 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now