PDA

Click to See Complete Forum and Search --> : ginger1


Kurzo
Mar 17th, 2001, 01:04 PM
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?

asabi
Mar 17th, 2001, 11:20 PM
Please try to be more specific..

Kurzo
Mar 17th, 2001, 11:56 PM
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

Kurzo
Mar 18th, 2001, 12:05 AM
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 =)

monte96
Mar 19th, 2001, 11:12 AM
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.

Kurzo
Mar 19th, 2001, 02:04 PM
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?

monte96
Mar 28th, 2001, 03:28 PM
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!)