Results 1 to 3 of 3
  1. #1
    Join Date
    Nov 2005
    Posts
    3

    Unanswered: Help: Trouble with remote data access using ADODB

    Hi everyone, I'm just a newbie in DB programming and I'm having a trouble:

    I have a database located in my IIS server: "c:\inetpub\wwwroot\webapplication1\dbs1.mdb".

    I'm also developing an VB6 pp in another computer which will access to my IIS server to get data in my database. I'm using ADODB, but I don't know how to establish the connection as well as to get the data from the server (remote machine).

    Can anyone in here help me by showing an example in VB6 code?
    Thank you very much, any sugestion is welcome

  2. #2
    Join Date
    Jun 2005
    Posts
    61

    hope that will help

    hi
    hope that will help

    Dim cnn As New ADODB.Connection
    Dim cmd As New ADODB.Command
    Dim rst As New ADODB.Recordset
    ...
    cnn.Open "..."
    cmd.Name = "yourCommandName"
    cmd.ActiveConnection = cnn
    ...
    'Your command name, any parameters, and an optional Recordset.
    cnn.yourCommandName "parameter", rst

    To execute a stored procedure, issue a statement where the stored procedure name is used as if it were a method on the Connection object, followed by any parameters. ADO will make a "best guess" of parameter types. For example:

    Dim cnn As New ADODB.Connection
    ...
    'Your stored procedure name and any parameters.
    cnn.sp_yourStoredProcedureName "parameter
    Sami Al Damiri ...

  3. #3
    Join Date
    Nov 2005
    Posts
    3
    Thank you Sam76, I have tried your suggestion, but I'm sorry it didnt work! The problem here is, my database is in the server side(on a remote machine), so that I have to establish a connection to the database first. As your instructions, it works well if the database is local only!
    Can you please tell me how do I establish a remote connection to a server by using ADODB and without objection of firewalls...?
    Thank you so much

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •