|
-
Mar 17th, 2001, 02:04 PM
#1
Thread Starter
Lively Member
Is it possible to have a VB application on your local machine and connect to a Database on an internet Server?
Say I upload a DB to my home page, can I build an app that can intereact with it? All I want it to do is log on to the internet to DB-1, and have it read another DB(DB-2) on my local machine to retrieve a recordset that will be appended to a table on DB-1.
Is this possible? How would I code such a connection?
-
Mar 18th, 2001, 12:20 AM
#2
Hyperactive Member
Please try to be more specific..
In the beginning the universe was created. This has made a lot of people very angry and is generally regarded as a bad idea.
- Douglas Adams
The Hitchhiker's Guide to the Galaxy
-
Mar 18th, 2001, 12:56 AM
#3
Thread Starter
Lively Member
Well, I found out I need to use RDS (I think) I wrote a small app that uses http to retrieve a recordset from my local machine.
What I don't understand is what to use as a DSN on a remote server.
Here is the code I used:
Option Explicit
Dim rs As Object 'Recordset
Dim ds As Object 'RDS.DataSpace
Dim df As Object 'RDSServer.DataFactory
Private Sub Command2_Click()
Me.lstCustomer.Clear
End Sub
Private Sub Form_Load()
Set ds = CreateObject("RDS.DataSpace")
Set df = ds.CreateObject("RDSServer.DataFactory", _
"http://localHost")
End Sub
Private Sub Command1_Click()
Screen.MousePointer = vbHourglass
'This query returns a recordset over HTTP.
Dim strCn As Variant, strSQL As Variant
strCn = "dsn=vbTest"
strSQL = "select ID,UserName,Password, UserLevel from tblUsers"
Set rs = df.Query(strCn, strSQL)
Do Until rs.EOF
lstCustomer.AddItem rs!UserName & " " & rs!Password
lstCustomer.ItemData(lstCustomer.NewIndex) = rs!ID
rs.MoveNext
Loop
Set rs = Nothing
Screen.MousePointer = vbNormal
End Sub
-
Mar 18th, 2001, 01:05 AM
#4
Thread Starter
Lively Member
In addition to the abouve post, I want to be able to retrieve a second recordset from my local hard drive (in a seperate database) and append it to the internet database.
Say I made a sales contact today, I enter the info into my local Database. At the end of the day, I run the above code to connect to my internet DB. I want to get the info from my local DB and append it to my internet DB to keep it current.
Hope that clears it up a bit =)
-
Mar 19th, 2001, 12:12 PM
#5
Frenzied Member
Your answer is no if your using Access. You can not access an Access database over the internet on a remote machine unless it is part of your network and you can access the actual directory of the access DB.
oOOo--oOOo
__ /\/\onte96
oOOo--oOOo
Senior Programmer/Analyst
MCP
[email protected]
[email protected]
Your results may vary.. some restrictions may apply.. pricing and participation may vary.. not available in all states.. professional driver closed course..quantities limited..
-
Mar 19th, 2001, 03:04 PM
#6
Thread Starter
Lively Member
I am using Access. If the administrator sets up a dsn for me on the remote server, will that work? Or will I have to use SQL Server?
If I use SQL Server, will I still have to get a dsn set up by the web server administrator?
-
Mar 28th, 2001, 04:28 PM
#7
Frenzied Member
Access is designed to intentionally not do what you're trying to do.
It will definitely work on SQL Server since you can connect over TCP/IP with and without a DNS. (Assuming it is not behind a firewall!)
oOOo--oOOo
__ /\/\onte96
oOOo--oOOo
Senior Programmer/Analyst
MCP
[email protected]
[email protected]
Your results may vary.. some restrictions may apply.. pricing and participation may vary.. not available in all states.. professional driver closed course..quantities limited..
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|