Results 1 to 7 of 7

Thread: ginger1

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Oct 2000
    Location
    Winnipeg, Manitoba Canada
    Posts
    96

    Question

    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?

  2. #2
    Hyperactive Member
    Join Date
    Mar 2000
    Location
    Canada
    Posts
    264
    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

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Oct 2000
    Location
    Winnipeg, Manitoba Canada
    Posts
    96
    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

  4. #4

    Thread Starter
    Lively Member
    Join Date
    Oct 2000
    Location
    Winnipeg, Manitoba Canada
    Posts
    96
    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 =)

  5. #5
    Frenzied Member monte96's Avatar
    Join Date
    Sep 2000
    Location
    Somewhere in AZ
    Posts
    1,379
    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..

  6. #6

    Thread Starter
    Lively Member
    Join Date
    Oct 2000
    Location
    Winnipeg, Manitoba Canada
    Posts
    96
    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?

  7. #7
    Frenzied Member monte96's Avatar
    Join Date
    Sep 2000
    Location
    Somewhere in AZ
    Posts
    1,379
    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
  •  



Click Here to Expand Forum to Full Width