Results 1 to 5 of 5

Thread: Problems updating serverside DB from Web Page?

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Mar 2001
    Location
    Southern California
    Posts
    733
    Hi,

    I've created an ActiveX control that I use on a web page. The purpose is to register guests and send the data to a database on my web server. I have the "action=" set to my server address and the location of the ASP script...I'm not sure if that is right or not. Anyway, I keep getting the

    "The page cannot be displayed"

    error. I've attached my ASP script to see if there is a problem with that.

    Thanks,
    Jeff
    Attached Files Attached Files

  2. #2
    Frenzied Member monte96's Avatar
    Join Date
    Sep 2000
    Location
    Somewhere in AZ
    Posts
    1,379
    1st and foremost, you can not access an Access database like this.

    Your data source attribute must be a physical path to the database file.

    Myconn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=C:\INetPub\wwwroot\reg\tsm2000.mdb; Initial Catalog=Your Database; User ID=Your Login; Password=Your Password"

    Also, look at the entire page when it says can not be displayed. There may be an error message that is useful further down on the page.

    Are you sure you are opening the database with an updatable cursor?

    Why are you doing the update in the web page? You should put it inside a method of the component and pass the values to it. Return a true or false if sucessfull or not or maybe an error message if one is generated.
    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..

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Mar 2001
    Location
    Southern California
    Posts
    733

    Response to Monte96

    Monte,

    Thanks for your input. I'm pretty new to Web development so any input is greatly appreciated.

    As far as updating my table, I thought I was doing it from the script which resides on the server...am I wrong? Is there a better way, if so, do you have an example?

    Thanks,
    Jeff

  4. #4
    Frenzied Member monte96's Avatar
    Join Date
    Sep 2000
    Location
    Somewhere in AZ
    Posts
    1,379
    Well, I'm not sure what your activeX component is buying you. You can create a recordset pretty easily in ASP VBScript with no ActiveX at all....

    If your going to use an ActiveX component for your data services, which is not a bad idea at all, you should keep all your data reads and writes in the activeX component.

    That way the only way data can be written to the database is through your component.

    That includes creating your connection. Your component does not have access to the connection object you are opening in the ASP page. It is out of scope. It should also be opened inside the component.

    Pass the values you are changing to a method in the component where you can update the database.
    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..

  5. #5

    Thread Starter
    Fanatic Member
    Join Date
    Mar 2001
    Location
    Southern California
    Posts
    733
    Monte96,

    Thanks again for your help. I believe I know what you mean. I'll give that method a try and see what happens.

    Thanks again.
    Jeff

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