Next MySQL Question

Next MySQL Question

Postby gkuhnert » Sat Sep 27, 2008 11:00 am

Hi,

when I create a new sql-table, I get an error message, but the table is being created anyway, exactly as I want the table to be. Any ideas, how I won't get an error but still the same table?

This is my code:
Code: Select all  Expand view
function neue_tabelle()
local cExec

cExec := "CREATE TABLE test ("+;
    "id INT NOT NULL AUTO_INCREMENT, "+;
    "name VARCHAR(50), "+;
    "place VARCHAR(50), "+;
    "PRIMARY KEY (id) )"

oConSql:Execute(cExec)

return .t.




and this the error I get:
Application
===========
Path and name: C:\FWH\samples\1sql.exe (32 bits)
Size: 1,573,888 bytes
Time from start: 0 hours 0 mins 1 secs
Error occurred at: 09/27/08, 12:53:16
Error description: Error ADODB.Connection/0 S_OK: EXECUTE
Args:
[ 1] = C CREATE TABLE test (id INT NOT NULL AUTO_INCREMENT, name VARCHAR(50), place VARCHAR(50), PRIMARY KEY (id) )

Stack Calls
===========
Called from: source\rtl\win32ole.prg => TOLEAUTO:EXECUTE(0)
Called from: 1sql.prg => NEUE_TABELLE(90)
Called from: 1sql.prg => (b)BUILDMENU(125)
Called from: .\source\classes\MENU.PRG => TMENU:COMMAND(0)
Called from: .\source\classes\WINDOW.PRG => TWINDOW:COMMAND(0)
Called from: .\source\classes\MDIFRAME.PRG => TMDIFRAME:COMMAND(0)
Called from: => TMDIFRAME:HANDLEEVENT(0)
Called from: .\source\classes\WINDOW.PRG => _FWH(0)
Called from: => WINRUN(0)
Called from: .\source\classes\WINDOW.PRG => TMDIFRAME:ACTIVATE(0)
Called from: 1sql.prg => MAIN(37)
Best Regards,

Gilbert Kuhnert
CTO Software GmbH
http://www.ctosoftware.de
User avatar
gkuhnert
 
Posts: 274
Joined: Fri Apr 04, 2008 1:25 pm
Location: Aachen - Germany // Kerkrade - Netherlands

Re: Next MySQL Question

Postby Enrico Maria Giordano » Sat Sep 27, 2008 12:16 pm

Try your query using an administrator tool for MySQL.

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8419
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Postby gkuhnert » Sat Sep 27, 2008 12:24 pm

Enrico,

I copied the syntax directly into phpmyadmin and it works.
Best Regards,

Gilbert Kuhnert
CTO Software GmbH
http://www.ctosoftware.de
User avatar
gkuhnert
 
Posts: 274
Joined: Fri Apr 04, 2008 1:25 pm
Location: Aachen - Germany // Kerkrade - Netherlands

Postby Armando » Sat Sep 27, 2008 5:09 pm

Gilbert:

Try this way to get more info about the error

Code: Select all  Expand view
TRY
   oConSql:Execute(cExec)
CATCH oError
   MsgStop("I Can't to create the table !")
   ShowError(oError)
END


And this is the ShowError() function:

Code: Select all  Expand view
FUNCTION ShowError(oError)
FOR EACH oError IN oConSql:Errors
   MsgInfo( "   Descripción:  "+oError:Description+CRLF+;
            "  Error Nativo:  "+STR(oError:NativeError)+CRLF+;
            "Número Error:  "+STR(oError:Number)+CRLF+;
            "           Origen:  "+oError:Source+CRLF+;
            "   Estado SQL:  "+oError:SQLState )
NEXT
RETURN(NIL)

Regards
SOI, s.a. de c.v.
estbucarm@gmail.com
http://www.soisa.mex.tl/
http://sqlcmd.blogspot.com/
Tel. (722) 174 44 45
Carpe diem quam minimum credula postero
User avatar
Armando
 
Posts: 3106
Joined: Fri Oct 07, 2005 8:20 pm
Location: Toluca, México


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 30 guests