?
Solved

Simple Question: need it to look at  server for my database instead of computer

Posted on 2003-03-11
28
Medium Priority
?
138 Views
Last Modified: 2010-05-01
 Set db = OpenDatabase(App.LogPath = "\siteusers.mdb")

instead of looking at my local hard drive id like it to look at a db on a webserver.


thanks for looking :)
0
Comment
Question by:jwduke3d
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 16
  • 12
28 Comments
 
LVL 18

Expert Comment

by:Sethi
ID: 8117299
Simply pass the path of the webserver instead of App.LogPath and the name of the database file instead of siteusers.mdb. The path of the webserver can be obtained from the Service Provider where you are hosting your site.
0
 

Author Comment

by:jwduke3d
ID: 8132019
could u show me in example?
0
 
LVL 18

Expert Comment

by:Sethi
ID: 8132585
ServerName\PhysicalPathOfDatabase\NameOfDatabase For example:
117.115.25.01\MyDocuments\siteusers.mdb
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

Author Comment

by:jwduke3d
ID: 8135445
i have the path of the webserver... its somthing like: C:\Inetpub\user\public_html

u want that where the app.logpath is? and then like

\login\siteusers.mbd ? because if thats what u mean.. i just dont see it working.. im sure u dont mean that :)

0
 
LVL 18

Expert Comment

by:Sethi
ID: 8135577
No No...This is not what I mean...The IP address is for the name of the server...so if you are at yahoo.com then instead of 117.115.25.01 type www.yahoo.com then after that give the physical path where you mdb file is stored on that server. App.Logpath = 117.115.25.01\MyDocuments\My.mdb
0
 

Author Comment

by:jwduke3d
ID: 8140391
ooo OK
i got you now... ill give it a try
0
 

Author Comment

by:jwduke3d
ID: 8140403
when i try that:
    Set db = OpenDatabase(App.LogPath = "111.111.111.111\somthing\siteusers.mdb")
i get runtime error 3024

"couldnot find file 'false'
0
 

Author Comment

by:jwduke3d
ID: 8141514
when i try that:
    Set db = OpenDatabase(App.LogPath = "111.111.111.111\somthing\siteusers.mdb")
i get runtime error 3024

"couldnot find file 'false'
0
 
LVL 18

Expert Comment

by:Sethi
ID: 8142189
Just check whether you are authorized to look into the server or not?
0
 

Author Comment

by:jwduke3d
ID: 8142776
should i go about that by emailing the admins of my webserver?
0
 
LVL 18

Expert Comment

by:Sethi
ID: 8143468
Oh man. Till now I thought that the server you were trying to access is in your own network. Yes, you will need to ask the admin of the webserver where you are hosting the site for permission to acces your database through VB and most likely he/she is going to DENY you the permission becuase of security reasons. However, if they have the policy to allow access then try your luck.
0
 

Author Comment

by:jwduke3d
ID: 8155784
ok, it seems they have no problem with me accessing the DB this way, they ned to know what kind of access i need, they questioned if i couldnt just use a DSN connection any ideA?
0
 

Author Comment

by:jwduke3d
ID: 8155879
ok, it seems they have no problem with me accessing the DB this way, they ned to know what kind of access i need, they questioned if i couldnt just use a DSN connection any ideA?
0
 

Author Comment

by:jwduke3d
ID: 8155907
ok, it seems they have no problem with me accessing the DB this way, they ned to know what kind of access i need, they questioned if i couldnt just use a DSN connection any ideA?
0
 
LVL 18

Expert Comment

by:Sethi
ID: 8156728
jwduke3d, please donot repeat your comments. No issues with DSN. Ask them the DSN name and in your connection string simply mention the DSN name. For connection strings refer to this link:
http://www.able-consulting.com/ADO_Conn.htm 
0
 

Author Comment

by:jwduke3d
ID: 8158248
im sorry i want paying atttention and hit the refresh button to see if you had answered yet :(  
0
 
LVL 18

Expert Comment

by:Sethi
ID: 8159978
No Problem. I also faced the same initially until an expert pointed it out for me. Did the link solve your DSN problem?
0
 

Author Comment

by:jwduke3d
ID: 8163667
I just cant get this right :( the link didnt help maybe you could show me an example of the string??
0
 
LVL 18

Expert Comment

by:Sethi
ID: 8166828
Simply ask you Service Providers to create a DSN for you and open the connection in the following manner:

Dim objConnection as New ADODB.Connection
objConnection.open "dsn=yamaha;Server=IP Address of the Server"
0
 
LVL 18

Expert Comment

by:Sethi
ID: 8166841
Also ask them to authorize you to execute this code, becuase unless they authorize your machine, you cant access the database on their server.
0
 

Author Comment

by:jwduke3d
ID: 8170964
i can create my own DSN connection through my control panel... lets try it out :)
0
 

Author Comment

by:jwduke3d
ID: 8170988
i get, user define type not defined :(
0
 

Author Comment

by:jwduke3d
ID: 8170993
this may help you some here is the entire login source:

Private Sub Login_Click()
    Dim db As Database
    Dim rs As Recordset
   
    Set db = OpenDatabase(App.LogPath = "\siteusers.mdb")
   
    Set rs = db.OpenRecordset("users")
   
    Do While Not rs.EOF
        If rs.Fields("username") = (txtLogin.Text) And _
        rs.Fields("password") = (txtPassword.Text) Then
       
        frmLogin.Visible = False
        frmMain.Visible = True
        frmMain.txtName.Text = txtLogin.Text
       
        Exit Sub
    Else
        rs.MoveNext
        End If
    Loop
    txtPassword.Text = ""
    MsgBox "Incorrect Password!", vbCritical
End Sub


that is it as is... now what needs fixing :-/
0
 
LVL 18

Expert Comment

by:Sethi
ID: 8171057
You are not mentioning the DSN anywhere. Look at the link I mentioned above and Open the database using the connection string mentioned in the link.
0
 

Author Comment

by:jwduke3d
ID: 8171115
that was as is... so replace
Set db = OpenDatabase(App.LogPath = "\siteusers.mdb")
WITH
Dim objConnection as New ADODB.Connection
objConnection.open "dsn=yamaha;Server=IP Address of the Server"
0
 
LVL 18

Accepted Solution

by:
Sethi earned 180 total points
ID: 8171205
You are using DAO and the example I gave you was for ADO becuase its a long time since I used DAO. The idea is to help you understand the concept that you require a DSN and the path to a server to connect to the database on the net. Since I cant spare the time relook into DAO I have given you an example in ADO. The site: http://www.able-consulting.com/ADO_Conn.htm will give you the exact DSN string that can be used with DAO. Also go through the following sites to look in for code samples:
http://www.vbcode.com/asp/code.asp?lstCategory=Database
http://www.codeguru.com/vb/Database/index.shtml
www.planet-source-code.com
0
 

Author Comment

by:jwduke3d
ID: 8171495
thankyou so much for all the help you have given me :)
0
 
LVL 18

Expert Comment

by:Sethi
ID: 8171704
Anytime ;-)
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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 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…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…
Suggested Courses

765 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