-
demo fails
I am using the code in example B1 on
http://www.aspdbtest.com/examples/basic/aspdbexb01.asp
I am getting this error. This is my first attempt at using ASP-DB.
ASP error '800a005b'
Object variable or With block variable not set
/report.asp, line 20
Here is my code:
<%
Set MyDb=Server.CreateObject("ASP.db") ' Create the ASP-db object
MyDb.dbQuickProps="1;Pubs;*;grid;4,auto,lightgrey" ' Set its std properties
Mydb.dbDSN = "DSN=appointments;UID=xx;PWD=xx;"
MyDb.dbDBType = "ACCESS"
MyDb.dbSQL = "*" 'Put in your own SQL here
MyDb.ASPdb ' Display it!
%>
Last edited by richb2; 09-15-2003 at 12:04 PM.
-
Hi,
First of all, that is a SQL Server database example. The file PUBS is a "demo" database that comes with SQL Server. I see you've also set the db type to Access. Odds are you don't even have a database called pubs, right?
Let's take a quick look at the dbQuickProps line in that example. It contains:
1;Pubs;*;
The 1 is the dbUnitNo. 1 is fine.
The Pubs is the Database/DSN name. You need to change that to a DSN you have on your system (see Data Sources / ODBC in your control panel and create a System DSN).
The "*" is the dbSQL property, and "*" means show "all tables" - just like the example. You actually don't need your dbDBtype (it defaults to Access), or your dbSQL (it's set to "*" in the QuickProps already). Just correct the DSN and you'll be fine.
Thanks,
John
P.S. See the BASIC1.ASP program to verify you've got things working right. Go to http://www.aspdbtest.com/std-default.htm and try out the programs there. They basically step you through testing your system.
-
It is all fixed now. It seems that my hoster installed the program incorrectly. Now it works perfectly. Thanks.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|