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.
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..
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?
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..