p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   Classic ASP Databases (http://p2p.wrox.com/forumdisplay.php?f=62)
-   -   Create Temporary Table (http://p2p.wrox.com/showthread.php?t=10378)

jmss66 March 10th, 2004 05:39 PM

Create Temporary Table
 
Hi Guys,

How do I create a temporary table and destroy it afterwards. This temporary table will have a recordset coming from another table and will also have other information coming from a user input. I am using ADO Connection. If someone can please me a sample code or give me a book or site I can look at so I can create this temp table. I appreciate all the help you can extend me.

Cheers,
Judy


Toran March 10th, 2004 06:36 PM

what DBMS are you going to use?


... there is always more to learn...

jmss66 March 11th, 2004 10:22 AM

I will be using ACCESS 2000.


jmss66 March 11th, 2004 12:41 PM

I was able to look at some sample Create table codes. After adding this create table code I am getting this error code:

Error Type:
Microsoft JET Database Engine (0x80040E14)
Syntax error in CREATE TABLE statement.
/MainServer/Main.asp, line 371


below is my create table code. I am using Microsoft.Jet.OLEDB.4.0 ACCESS 2000. Please someone, I need help on this. Is it because Jet OLEDB 4.0 does not support this create table? If not then what should I do? Any suggestions? Thanks.

set rsTempTb = Server.CreateObject("ADODB.Recordset")
sqlString = "CREATE TABLE Names (FirstName TEXT (20), LastName TEXT (20), DateOfBirth DATETIME, CONSTRAINT MultiConstraint UNIQUE(FirstName, LastName, DateOfBirth) )"
rsCART.Open sqlString, objconn, adOpenKeyset,adLockOptimistic



jmss66 March 11th, 2004 12:45 PM

I am sorry I did a Typing error when I posted the create table code.

The .open statement was suppose to be :

rsTempTb.Open sqlString, objconn, adOpenKeyset,adLockOptimistic

Thanks,
Judy


jmss66 March 11th, 2004 01:00 PM

Okay. After playing with it some more I was finally able to create it. My mistake was I was creating a table and a recordset at the same time. What I did was :

sqlString = "CREATE TABLE Names (FirstName TEXT (20), LastName TEXT (20), DateOfBirth DATETIME, CONSTRAINT MultiConstraint UNIQUE(FirstName, LastName, DateOfBirth) )"
objconn.Execute (strSQL)

This created a table. Now I have to figure out how to delete or destroy this table after session is over.

Thanks,
Judy



All times are GMT -4. The time now is 02:59 AM.

Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.