ASP connection string (remote MS Access db)

Ask a Question related to ASP Database, Design and Development.

  1. #1

    Default ASP connection string (remote MS Access db)

    I am having problems connecting to a MS Access DB that is on a network
    server (not local) through ADO/ASP.

    Here is the latest version of my connection string:
    'set connmajors = server.CreateObject("ADODB.Connection")
    'connmajors.Open "Provider=Microsoft.Jet.OLEDB.4.0; Data
    Source=\\server\accessdb.mdb; Uid=***; Pwd=***;"

    This does not work. I want to use a DSNless connection, but there are
    so many examples of different types of those- I am a bit confused. Do I
    even need the username/password?

    My goal is to connect to a MS Access db to pull values from a table to
    populate a drop down list.

    Does anyone have experience trying to get MS Access data off of a server
    and populate a drop down list?

    Thanks
    Jesse

    WoG Guest

  2. Similar Questions and Discussions

    1. Access dbase connection string errors
      I keep getting "Unable to open registry key 'Temporary (volatile) Jet DSN " errors pointing to my connection string when the same connection string...
    2. Problem with Remote Access Connection Manager
      This machine has been upgraded from XP Home to XP Pro and is a member of a Windows 2000 domain. The user is a local admin of the machine. The...
    3. Can not start Remote Access Connection Manager service
      Hi all, On XP Home, I was having various problems (components of "search missing", etc.), so I re-ran setup from the original CD and chose the...
    4. Remote access connection manager service cannot be started.
      I have upgraded from windows XP home edition to windows XP pro. After the installation the dial up networking options are not highlighted. Further...
    5. remote access connection manager
      I did a repair of Win XP as I was getting Not Responding problems with my Iexplorer. This was through the regular bootup repair not the console...
  3. #2

    Default Re: ASP connection string (remote MS Access db)

    [url]http://www.aspfaq.com/2168[/url]

    --
    Aaron Bertrand
    SQL Server MVP
    [url]http://www.aspfaq.com/[/url]




    "WoG" <jesusfreaks18@hotmail.com> wrote in message
    news:ux61$fcPEHA.2128@TK2MSFTNGP11.phx.gbl...
    > I am having problems connecting to a MS Access DB that is on a network
    > server (not local) through ADO/ASP.
    >
    > Here is the latest version of my connection string:
    > 'set connmajors = server.CreateObject("ADODB.Connection")
    > 'connmajors.Open "Provider=Microsoft.Jet.OLEDB.4.0; Data
    > Source=\\server\accessdb.mdb; Uid=***; Pwd=***;"
    >
    > This does not work. I want to use a DSNless connection, but there are
    > so many examples of different types of those- I am a bit confused. Do I
    > even need the username/password?
    >
    > My goal is to connect to a MS Access db to pull values from a table to
    > populate a drop down list.
    >
    > Does anyone have experience trying to get MS Access data off of a server
    > and populate a drop down list?
    >
    > Thanks
    > Jesse
    >

    Aaron Bertrand - MVP Guest

  4. #3

    Default Re: ASP connection string (remote MS Access db)

    Aaron-

    Thanks for helping me get connected- the advice worked.

    However, I am now getting an error that says cannot create Business
    Object, or something like that.

    Know what that means? Is it a permission problem with the remote server?

    Thanks,
    Jesse


    Aaron Bertrand - MVP wrote:
    > [url]http://www.aspfaq.com/2168[/url]
    >
    WoG Guest

  5. #4

    Default Re: ASP connection string (remote MS Access db)

    > However, I am now getting an error that says cannot create Business
    > Object, or something like that.
    Can you be more specific? It's hard to tell google or aspfaq.com or other
    search engines to search for "something like ... " ... however, if you
    include the actual error message instead of a paraphrase, I might recognize
    it straight off, or find a relevant article within a few seconds.


    Aaron Bertrand - MVP Guest

  6. #5

    Default Re: ASP connection string (remote MS Access db)

    My apologies-

    It's error 800a1004
    "Business Object cannot be created"

    I've googled it as well, not coming up with much...

    Thanks
    Jesse

    Aaron Bertrand - MVP wrote:
    >>However, I am now getting an error that says cannot create Business
    >>Object, or something like that.
    >
    >
    > Can you be more specific? It's hard to tell google or aspfaq.com or other
    > search engines to search for "something like ... " ... however, if you
    > include the actual error message instead of a paraphrase, I might recognize
    > it straight off, or find a relevant article within a few seconds.
    >
    >
    WoG Guest

  7. #6

    Default Re: ASP connection string (remote MS Access db)

    WoG wrote:
    > My apologies-
    >
    > It's error 800a1004
    > "Business Object cannot be created"
    >
    What is the line of code that generates this error? It does not sound like a
    MS error message.

    Bob Barrows
    --
    Microsoft MVP -- ASP/ASP.NET
    Please reply to the newsgroup. The email account listed in my From
    header is my spam trap, so I don't check it very often. You will get a
    quicker response by posting to the newsgroup.


    Bob Barrows [MVP] Guest

  8. #7

    Default Re: ASP connection string (remote MS Access db)

    I can say with 99% certainty that this error has nothing to do with
    connecting to the database itself. Perhaps you have some kind of
    OLEAutomation in a query or something within the database, but it would help
    if you could narrow down exactly where this happens in your code (none of
    which we've seen thus far).

    --
    Aaron Bertrand
    SQL Server MVP
    [url]http://www.aspfaq.com/[/url]




    "WoG" <jesusfreaks18@hotmail.com> wrote in message
    news:#ILpYtdPEHA.1620@TK2MSFTNGP12.phx.gbl...
    > My apologies-
    >
    > It's error 800a1004
    > "Business Object cannot be created"
    >
    > I've googled it as well, not coming up with much...
    >
    > Thanks
    > Jesse
    >
    > Aaron Bertrand - MVP wrote:
    > >>However, I am now getting an error that says cannot create Business
    > >>Object, or something like that.
    > >
    > >
    > > Can you be more specific? It's hard to tell google or aspfaq.com or
    other
    > > search engines to search for "something like ... " ... however, if you
    > > include the actual error message instead of a paraphrase, I might
    recognize
    > > it straight off, or find a relevant article within a few seconds.
    > >
    > >
    >

    Aaron Bertrand - MVP Guest

  9. #8

    Default Re: ASP connection string (remote MS Access db)

    Oh wait. You're attempting to use RDS, which has nothing to do with ASP -
    it's all client-side code.
    Here is a KB article about this error:
    [url]http://support.microsoft.com/?kbid=251122[/url]

    Please go to a RDS or remotescripting newsgroups if you need more help with
    this.

    Bob Barrows

    WoG wrote:
    > My apologies-
    >
    > It's error 800a1004
    > "Business Object cannot be created"
    >
    > I've googled it as well, not coming up with much...
    >
    > Thanks
    > Jesse
    >
    > Aaron Bertrand - MVP wrote:
    >>> However, I am now getting an error that says cannot create Business
    >>> Object, or something like that.
    >>
    >>
    >> Can you be more specific? It's hard to tell google or aspfaq.com or
    >> other search engines to search for "something like ... " ...
    >> however, if you include the actual error message instead of a
    >> paraphrase, I might recognize it straight off, or find a relevant
    >> article within a few seconds.
    --
    Microsoft MVP -- ASP/ASP.NET
    Please reply to the newsgroup. The email account listed in my From
    header is my spam trap, so I don't check it very often. You will get a
    quicker response by posting to the newsgroup.


    Bob Barrows [MVP] Guest

  10. #9

    Default Re: ASP connection string (remote MS Access db)

    here is the connection string and the recordset opening:

    <%
    'Request the majors list for a dropdown
    SQLMAJORS = "SELECT Majorn, Major FROM Majors"

    cst = "Provider=MS Remote;" &_
    "Remote Server=server;" &_
    "Remote Provider=Microsoft.Jet.OLEDB.4.0;" &_
    "Data Source=folder/correctdb.mdb;"
    set conn = server.CreateObject("ADODB.Connection")
    conn.open cst
    set stuff = server.CreateObject("ADODB.Recordset")

    stuff.open SQLMAJORS, conn
    dim Q, rs_1
    Q = chr(34)
    %>

    The error line is:
    stuff.open SQLMAJORS, conn

    Jesse

    Aaron Bertrand - MVP wrote:
    > I can say with 99% certainty that this error has nothing to do with
    > connecting to the database itself. Perhaps you have some kind of
    > OLEAutomation in a query or something within the database, but it would help
    > if you could narrow down exactly where this happens in your code (none of
    > which we've seen thus far).
    >
    WoG Guest

  11. #10

    Default Re: ASP connection string (remote MS Access db)

    > "Data Source=folder/correctdb.mdb;"

    What is this? You'll notice in the article that you need to specify the
    *LOCAL* *ABSOLUTE* path on the remote server. So, if the remote server has
    c:\inetpub\wwwroot\folder\correctdb.mdb you need to put that. A relative
    path won't work.

    A


    Aaron Bertrand - MVP Guest

  12. #11

    Default Re: ASP connection string (remote MS Access db)

    Yeah, I know- I just didn't feel like posting that path on this forum.
    Thanks though.

    Jesse

    Aaron Bertrand - MVP wrote:
    >> "Data Source=folder/correctdb.mdb;"
    >
    >
    > What is this? You'll notice in the article that you need to specify the
    > *LOCAL* *ABSOLUTE* path on the remote server. So, if the remote server has
    > c:\inetpub\wwwroot\folder\correctdb.mdb you need to put that. A relative
    > path won't work.
    >
    > A
    >
    >
    WoG Guest

  13. #12

    Default Re: ASP connection string (remote MS Access db)

    WoG wrote:
    > Yeah, I know- I just didn't feel like posting that path on this forum.
    > Thanks though.
    >
    So post this instead:
    "Data Source=" & Server.MapPath("folder/correctdb.mdb")

    Not only use it in your newsgroup posts, use it in your code as well.

    Bob Barrows

    --
    Microsoft MVP -- ASP/ASP.NET
    Please reply to the newsgroup. The email account listed in my From
    header is my spam trap, so I don't check it very often. You will get a
    quicker response by posting to the newsgroup.


    Bob Barrows [MVP] Guest

  14. #13

    Default Re: ASP connection string (remote MS Access db)

    > So post this instead:
    > "Data Source=" & Server.MapPath("folder/correctdb.mdb")
    No, he can't run the code that way. If he runs server.mappath() in the
    local ASP code, it will translate the relative path to the LOCAL web
    structure. He is connecting to an ASP database on a remote server, so he
    has to supply the absolute remote path.

    Anyway, what good does c:\folder\file.mdb give me? I'd have to know where
    his server is and then gain access to his file system to find the file. In
    contrast, exposing the relative path is arguably more dangerous... I only
    need to know where his server is, then I can just type the relative URL into
    the browser.

    --
    Aaron Bertrand
    SQL Server MVP
    [url]http://www.aspfaq.com/[/url]


    Aaron Bertrand - MVP Guest

  15. #14

    Default Re: ASP connection string (remote MS Access db)

    Aaron Bertrand - MVP wrote:
    >> So post this instead:
    >> "Data Source=" & Server.MapPath("folder/correctdb.mdb")
    >
    > No, he can't run the code that way. If he runs server.mappath() in
    > the local ASP code, it will translate the relative path to the LOCAL
    > web structure. He is connecting to an ASP database on a remote
    > server, so he has to supply the absolute remote path.
    Oh duh! That explains the RDS error message as well.



    --
    Microsoft MVP -- ASP/ASP.NET
    Please reply to the newsgroup. The email account listed in my From
    header is my spam trap, so I don't check it very often. You will get a
    quicker response by posting to the newsgroup.


    Bob Barrows [MVP] Guest

  16. #15

    Default Re: ASP connection string (remote MS Access db)

    Considering it's not even the correct relative path, it's a *VERY* moot
    point.

    Thanks for your help.
    Jesse

    Aaron Bertrand - MVP wrote:
    >>So post this instead:
    >>"Data Source=" & Server.MapPath("folder/correctdb.mdb")
    >
    >
    > No, he can't run the code that way. If he runs server.mappath() in the
    > local ASP code, it will translate the relative path to the LOCAL web
    > structure. He is connecting to an ASP database on a remote server, so he
    > has to supply the absolute remote path.
    >
    > Anyway, what good does c:\folder\file.mdb give me? I'd have to know where
    > his server is and then gain access to his file system to find the file. In
    > contrast, exposing the relative path is arguably more dangerous... I only
    > need to know where his server is, then I can just type the relative URL into
    > the browser.
    >
    WoG Guest

  17. #16

    Default Re: ASP connection string (remote MS Access db)

    > Considering it's not even the correct relative path, it's a *VERY* moot
    > point.
    I merely brought it up because you were afraid to post the real path here
    (and changing the format led to confusion).


    Aaron Bertrand - MVP Guest

  18. #17

    Default Re: ASP connection string (remote MS Access db)

    Quote Originally Posted by WoG View Post
    I am having problems connecting to a MS Access DB that is on a network
    server (not local) through ADO/ASP.

    Here is the latest version of my connection string:
    'set connmajors = server.CreateObject("ADODB.Connection")
    'connmajors.Open "Provider=Microsoft.Jet.OLEDB.4.0; Data
    Source=\\server\accessdb.mdb; Uid=***; Pwd=***;"

    This does not work. I want to use a DSNless connection, but there are
    so many examples of different types of those- I am a bit confused. Do I
    even need the username/password?

    My goal is to connect to a MS Access db to pull values from a table to
    populate a drop down list.

    Does anyone have experience trying to get MS Access data off of a server
    and populate a drop down list?

    Thank
    Jesse

    There is no need to use username/password.
    try it...it is working...
    but firstly u have to create DSN
    var axoConnection = new ActiveXObject("ADODB.Connection");
    var strConnection = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source = C:/snv.mdb";
    var axoRecordSet = new ActiveXObject("ADODB.Recordset");
    var SQL = "select x from snv";

    axoConnection.Open(strConnection);
    axoRecordSet.Open(SQL, axoConnection);


    while (axoRecordSet != null) {

    alert(axoRecordSet(0))
    axoRecordSet.movenext();
    break;

    }
    sattu Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139