Unable to create a temporary table

F

Faraz Azhar

Hello,

Im just trying to create a temporary table to do some work on it and I
want it to be deleted after my work is done (my program exits). Im
doing it the following way in VB6:


SQL = "CREATE TEMPORARY TABLE ViewInventoryLedger (dDate DATETIME,
Type TEXT (1), Voucher INTEGER, Quantity REAL, UnitCost REAL, Total
REAL)"

Conn.Execute SQL

This keeps giving syntax error. If I remove the TEMPORARY keyword, it
works ok. What am I missing here? Can anyone help please.
 
M

MGFoster

Faraz said:
Hello,

Im just trying to create a temporary table to do some work on it and I
want it to be deleted after my work is done (my program exits). Im
doing it the following way in VB6:


SQL = "CREATE TEMPORARY TABLE ViewInventoryLedger (dDate DATETIME,
Type TEXT (1), Voucher INTEGER, Quantity REAL, UnitCost REAL, Total
REAL)"

Conn.Execute SQL

This keeps giving syntax error. If I remove the TEMPORARY keyword, it
works ok. What am I missing here? Can anyone help please.

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Access doesn't have temporary tables. You'll have to create a regular
table and drop it before your program exits.

Instead of REAL data types I suggest you use DOUBLE. REAL translates to
a SINGLE data type. I've found that they sometimes don't round to 2
decimal places correctly.

HTH,
--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)
** Respond only to this newsgroup. I DO NOT respond to emails **

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBSkpKW4echKqOuFEgEQKkEwCeJ5Egx4Ev1E/b2IKSmjPGVc15M8cAoPzi
djPyP649YJmLAExrxJFJKoVu
=2zwL
-----END PGP SIGNATURE-----
 
F

Faraz Azhar

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Access doesn't have temporary tables.  You'll have to create a regular
table and drop it before your program exits.

Instead of REAL data types I suggest you use DOUBLE.  REAL translates to
a SINGLE data type.  I've found that they sometimes don't round to 2
decimal places correctly.

HTH,
--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)
** Respond only to this newsgroup.  I DO NOT respond to emails **

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBSkpKW4echKqOuFEgEQKkEwCeJ5Egx4Ev1E/b2IKSmjPGVc15M8cAoPzi
djPyP649YJmLAExrxJFJKoVu
=2zwL
-----END PGP SIGNATURE-----


Hmm... thanks! I've already spent tons of time trying to figure out
how to work out that TEMPORARY clause. Ill make a regular table and
kill it.
Thanks for that DOUBLE tip.. i'll make changes in my program!

Faraz Azhar
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top