MySQL Lists are EOL. Please join:

List:General Discussion« Previous MessageNext Message »
From:Jacque Scott Date:March 3 2004 7:12pm
Subject:CREATE TEMPORARY TABLE
View as plain text  
I am trying to create a temporary table through code in my DB.  I can do
it when I use MySQL Control Center or something like that, but when I
try to do it through my VB program it doesn't work.  
 
Here is the sql string:
 
CREATE TEMPORARY TABLE IndenturedList (Level_1 TEXT, Level_2 TEXT,
AssemblyNumber TEXT, NSIPartNumber TEXT, RecordID INT NOT NULL
AUTO_INCREMENT, PRIMARY KEY (RecordID));
 
If I paste this into MySQL Control Center I have no problem creating
it.  Here is the code from my VB program:
 
    Dim cn As New ADODB.Connection
    Dim RS As New ADODB.Recordset
    Dim fld As ADODB.Field
    Dim DataArray() As String
    Dim i As Long
    Dim lngRecordAffected As Long

    Set cn = New ADODB.Connection
   strSQL = "CREATE TEMPORARY TABLE IndenturedList (Level_1 TEXT,
Level_2 TEXT, AssemblyNumber TEXT, NSIPartNumber TEXT, RecordID INT NOT
NULL AUTO_INCREMENT, PRIMARY KEY (RecordID));"
            
    cn.Open "Driver={MySQL ODBC 3.51 Driver}; Server=" & gStrSQLServer
& ";database=NSITbls; uid=" & gStrCurrentUser & "; Password=" &
gStrCurrentUser & ";"
    
    cn.Execute strSQL, lngRecordAffected
 
Nothing happens when I run this code.  Is the SQL string only for a DAO
connection?  The reason I ask is because when I need to write data to
the db I just change the SQL string and it works.
 
Does anyone know what is wrong?
 
Thank you,
 
Jacque

Thread
CREATE TEMPORARY TABLEJacque Scott3 Mar
  • Re: CREATE TEMPORARY TABLEvpendleton3 Mar
Re: CREATE TEMPORARY TABLEJacque Scott3 Mar