Problem connecting to an access database from an asp

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

  1. #1

    Default Re: Problem connecting to an access database from an asp

    Stupid question: Does this page have a .asp extension?

    Ray at home

    "Kathryn" <andania1@hotmail.com> wrote in message
    news:42947ac.0308120137.70cab179@posting.google.co m...
    >
    > <SCRIPT language = VBSCRIPT RUNAT="server">
    > function UpdateDataBase()
    > set cn=Server.CreateObject("ADODB.Connection")
    >
    > Calling the script isn't the problem, it gets into this script but I
    > get the message "Object Expected" at runtime. The line it is
    > complaining about is the Server.CreateObject.

    Ray at Guest

  2. Similar Questions and Discussions

    1. please help connecting to access database
      i'm trying to connect to an access database on an asp ready server. i know the ftp login information - does that apply to logging into the database...
    2. Problem connecting to local Access database - Unable to open registry key 'Temporary (volatile) Jet DSN ...
      Hi I get the following error sporadically when running a sample in an MSDN ASP tutorial: Microsoft OLE DB Provider for ODBC Drivers: General...
    3. Connecting to MS Access Database
      Hello, Do you know any free Director Xtra to connect to an access database? Thanx for help.
    4. Connecting to an MS Access Database
      Hello, Do you know any free Director Xtra to connect to an access database? Thanx for help.
    5. connecting to access database
      How can we connect microsoft access database(*.mdb) or excel(*.xls) with php? What are the codes which achieve this? ...
  3. #2

    Default Re: Problem connecting to an access database from an asp

    > I have a problem which I'm beginning to think is something to do with
    > my installation or set up of Microsoft Personal Web Server. I have an
    > ASP front end to an access database from which I'm calling the
    > following script
    How are you accessing the file? [url]http://localhost/path/file.asp[/url] or
    c:\inetpub\wwwroot\path\file.asp? The latter won't work, ASP has to be
    processed by the web server, and to do so you need to access it via the
    http:// protocol...


    Aaron Bertrand - MVP Guest

  4. #3

    Default Re: Problem connecting to an access database from an asp

    what is this line?
    cn.Open "RunSettings"
    why don't you make it
    cn.Open RunSettings



    "Kathryn" <andania1@hotmail.com> wrote in message
    news:42947ac.0308120137.70cab179@posting.google.co m...
    > I hope this is the correct group to post this to!
    >
    > I have a problem which I'm beginning to think is something to do with
    > my installation or set up of Microsoft Personal Web Server. I have an
    > ASP front end to an access database from which I'm calling the
    > following script
    >
    > <SCRIPT language = VBSCRIPT RUNAT="server">
    > function UpdateDataBase()
    > Dim cn
    > Dim rs
    > Dim strSQL
    >
    > set cn=Server.CreateObject("ADODB.Connection")
    > cn.Open "RunSettings"
    >
    > strSQL = "INSERT INTO RunDetails(UserName) VALUES ('Fred')"
    >
    > cn.Execute strSQL
    > end function
    > </SCRIPT>
    >
    > Calling the script isn't the problem, it gets into this script but I
    > get the message "Object Expected" at runtime. The line it is
    > complaining about is the Server.CreateObject.
    >
    > At first I thought maybe the Microsoft ActiveX Data Objects wasn't
    > installed on my machine but it is because if I put the code above into
    > a VB program and run it within VB then it works.
    >
    > So, could this be something to do with my PWS setup?
    >
    > Any help would be appreciated as I'm beginning to pull my hair out!!
    >
    > Thanks.
    >
    > Kathryn.

    Bite My Bubbles Guest

  5. #4

    Default Re: Problem connecting to an access database from an asp

    do you have ado installed on your computer?
    Do you have a reference set in Global.asa to the ado library?

    "Kathryn" <andania1@hotmail.com> wrote in message
    news:42947ac.0308120137.70cab179@posting.google.co m...
    > I hope this is the correct group to post this to!
    >
    > I have a problem which I'm beginning to think is something to do with
    > my installation or set up of Microsoft Personal Web Server. I have an
    > ASP front end to an access database from which I'm calling the
    > following script
    >
    > <SCRIPT language = VBSCRIPT RUNAT="server">
    > function UpdateDataBase()
    > Dim cn
    > Dim rs
    > Dim strSQL
    >
    > set cn=Server.CreateObject("ADODB.Connection")
    > cn.Open "RunSettings"
    >
    > strSQL = "INSERT INTO RunDetails(UserName) VALUES ('Fred')"
    >
    > cn.Execute strSQL
    > end function
    > </SCRIPT>
    >
    > Calling the script isn't the problem, it gets into this script but I
    > get the message "Object Expected" at runtime. The line it is
    > complaining about is the Server.CreateObject.
    >
    > At first I thought maybe the Microsoft ActiveX Data Objects wasn't
    > installed on my machine but it is because if I put the code above into
    > a VB program and run it within VB then it works.
    >
    > So, could this be something to do with my PWS setup?
    >
    > Any help would be appreciated as I'm beginning to pull my hair out!!
    >
    > Thanks.
    >
    > Kathryn.

    Bite My Bubbles Guest

  6. #5

    Default Re: Problem connecting to an access database from an asp

    Thanks for all of your replies, in answer to your questions:

    Yes it does have a .asp extension.
    Yes I do have ADO installed on my machine.
    Yes I am calling it using [url]http://localhost[/url].....
    With our without the quotes around the RunSettings it does the same
    thing!

    I'm beginning to think its me doing something stupid in the way I'm
    calling the function! I have another asp file which has the input
    fields on it and a button at the bottom to update the database. In the
    onclick event in the button I call the function like
    onclick="UpdateDataBase()". It obviously calls the function because
    the error comes out of the function itself but maybe its not calling
    it in the correct way? Any suggestions as to a better way to call it?



    [email]andania1@hotmail.com[/email] (Kathryn) wrote in message news:<42947ac.0308120137.70cab179@posting.google.c om>...
    > I hope this is the correct group to post this to!
    >
    > I have a problem which I'm beginning to think is something to do with
    > my installation or set up of Microsoft Personal Web Server. I have an
    > ASP front end to an access database from which I'm calling the
    > following script
    >
    > <SCRIPT language = VBSCRIPT RUNAT="server">
    > function UpdateDataBase()
    > Dim cn
    > Dim rs
    > Dim strSQL
    >
    > set cn=Server.CreateObject("ADODB.Connection")
    > cn.Open "RunSettings"
    >
    > strSQL = "INSERT INTO RunDetails(UserName) VALUES ('Fred')"
    >
    > cn.Execute strSQL
    > end function
    > </SCRIPT>
    >
    > Calling the script isn't the problem, it gets into this script but I
    > get the message "Object Expected" at runtime. The line it is
    > complaining about is the Server.CreateObject.
    >
    > At first I thought maybe the Microsoft ActiveX Data Objects wasn't
    > installed on my machine but it is because if I put the code above into
    > a VB program and run it within VB then it works.
    >
    > So, could this be something to do with my PWS setup?
    >
    > Any help would be appreciated as I'm beginning to pull my hair out!!
    >
    > Thanks.
    >
    > Kathryn.
    Kathryn Guest

  7. #6

    Default Re: Problem connecting to an access database from an asp

    Yep, as William said, you're trying to call UpdateDataBase() on the
    client-side, and it's a server-side routine. Post the form back and process
    the input on the server.

    Alan

    "Kathryn" <andania1@hotmail.com> wrote in message
    news:42947ac.0308130021.7569ae2b@posting.google.co m...
    > Thanks for all of your replies, in answer to your questions:
    >
    > Yes it does have a .asp extension.
    > Yes I do have ADO installed on my machine.
    > Yes I am calling it using [url]http://localhost[/url].....
    > With our without the quotes around the RunSettings it does the same
    > thing!
    >
    > I'm beginning to think its me doing something stupid in the way I'm
    > calling the function! I have another asp file which has the input
    > fields on it and a button at the bottom to update the database. In the
    > onclick event in the button I call the function like
    > onclick="UpdateDataBase()". It obviously calls the function because
    > the error comes out of the function itself but maybe its not calling
    > it in the correct way? Any suggestions as to a better way to call it?
    >
    >
    >
    > [email]andania1@hotmail.com[/email] (Kathryn) wrote in message
    news:<42947ac.0308120137.70cab179@posting.google.c om>...
    > > I hope this is the correct group to post this to!
    > >
    > > I have a problem which I'm beginning to think is something to do with
    > > my installation or set up of Microsoft Personal Web Server. I have an
    > > ASP front end to an access database from which I'm calling the
    > > following script
    > >
    > > <SCRIPT language = VBSCRIPT RUNAT="server">
    > > function UpdateDataBase()
    > > Dim cn
    > > Dim rs
    > > Dim strSQL
    > >
    > > set cn=Server.CreateObject("ADODB.Connection")
    > > cn.Open "RunSettings"
    > >
    > > strSQL = "INSERT INTO RunDetails(UserName) VALUES ('Fred')"
    > >
    > > cn.Execute strSQL
    > > end function
    > > </SCRIPT>
    > >
    > > Calling the script isn't the problem, it gets into this script but I
    > > get the message "Object Expected" at runtime. The line it is
    > > complaining about is the Server.CreateObject.
    > >
    > > At first I thought maybe the Microsoft ActiveX Data Objects wasn't
    > > installed on my machine but it is because if I put the code above into
    > > a VB program and run it within VB then it works.
    > >
    > > So, could this be something to do with my PWS setup?
    > >
    > > Any help would be appreciated as I'm beginning to pull my hair out!!
    > >
    > > Thanks.
    > >
    > > Kathryn.

    Alan Guest

  8. #7

    Default Re: Problem connecting to an access database from an asp

    Kathryn wrote:
    > I call the function like
    > onclick="UpdateDataBase()". It obviously calls the function because
    > the error comes out of the function itself but maybe its not calling
    > it in the correct way? Any suggestions as to a better way to call it?
    >
    onclick is a client-side event.

    UpdateDataBase presumably needs to run on the server.

    --
    William Tasso - [url]http://WilliamTasso.com[/url]


    William Tasso Guest

  9. #8

    Default Re: Problem connecting to an access database from an asp

    Alan wrote:
    > as William said,
    Thanks Alan, I've fixed the time setting on my workstation now ;o)

    It marks time with a local server on boot-up, but it's old and it drifts -
    only noticable after a week or two.

    --
    William Tasso - [url]http://WilliamTasso.com[/url]


    William Tasso 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