|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
VB6 MYSQL - > Trying to load ascript file from VB6 -I have MySql 4.1 with VB6. I need to run a batch file via VB6 code which contains a bunch of create table statements & inserts of data. To do this from the command line of MySql I do, SOURCE c:/myscript.txt; This works perfectly , but not through VB6. This is what I got so far, 'Set up connection to MySql (works) Call connectMysql("root", "", gblIpAddress, "test", conn, rs) 'Create the Sql statement (works) ssql = "CREATE DATABASE IF NOT EXISTS mytest;" 'Execute the sql statement (works) conn.Execute (ssql) 'load the batch file to populate the database (Errors out here) ssql = "SOURCE c:/myscript.txt;" conn.Execute (ssql) I have tried (Same Error here) ssql = "LOAD DATA INFILE c:/myscript.txt;" conn.Execute (ssql) Please help.... If this is not the correct forum , please let me know, Thank you in advance, Jay Have you tried something like the following? I know the following is what I
do for Oracle - not sure if it's similar to My Sql.... ssql = "@c:\myscript.txt;" conn.execute (ssql) Leisa Show quoteHide quote "Jay Cee" wrote: > Hi all, > I have MySql 4.1 with VB6. > I need to run a batch file via VB6 code which contains a bunch > of create table statements & inserts of data. > To do this from the command line of MySql I do, > SOURCE c:/myscript.txt; > This works perfectly , but not through VB6. > > This is what I got so far, > > 'Set up connection to MySql (works) > Call connectMysql("root", "", gblIpAddress, "test", conn, rs) > > 'Create the Sql statement (works) > ssql = "CREATE DATABASE IF NOT EXISTS mytest;" > > 'Execute the sql statement (works) > conn.Execute (ssql) > > 'load the batch file to populate the database (Errors out here) > ssql = "SOURCE c:/myscript.txt;" > conn.Execute (ssql) > > I have tried (Same Error here) > ssql = "LOAD DATA INFILE c:/myscript.txt;" > conn.Execute (ssql) > > Please help.... > If this is not the correct forum , please let me know, > Thank you in advance, > Jay
AND Operator and Currency data type
FTP(not boring) Produktlokalisierung - wie funktioniert's? Consume Web Map Service (WMS) with VB6 "Save As" question & file extensions list of files in directories? Obtain MCSE certificaiton without exams(Pay after check results)100% passing gaurantee Adding treeview programacticlly Refactoring add-in Syntax Error - Missing Operator - When Using Date ! |
|||||||||||||||||||||||