Re: How can I run '.sql' script from vc++



Thanks Eric for ur help.

I have an 'Insert.sql' script in my source directory. On that Sql
file ,Iam trying to insert a value to a table.
I tried like this

ShellExecute(NULL, "open", "mysql", "mydb -u root -p root
Insert.sql", NULL, SW_SHOW);

But its not working..Where am I worng..

pls help





On Feb 27, 7:25 pm, "Eric Hill" <e...@xxxxxxxxx> wrote:
Hi,
Somebody please help me how can i rum a .sqlfile from vc++. Iam using
MFC with MySQL as backend.

Use CreateProcess orShellExecuteto launch the following:

mysql my_db_name -umy_user_name -pmy_password my_script.sql

If you need to get access to the database instead of just running a
script, a good place to start would be the C++ wrapper around the mysql C
API, called MySQL++.

Find it here:http://tangentsoft.net/mysql++/

Eric


.



Relevant Pages

  • More questions about porting from MySQL to MS SQL
    ... In several tables, in my MySQL version, I created columns using ... `ab_timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update ... I learned the hard way that MS SQL does not like ... FUNCTION and CREATE VIEW need to be the first statement in a script. ...
    (comp.databases.ms-sqlserver)
  • Re: script dies yet there are no errors in error log
    ... so the SQL became simple: ... script and the script ran in less than a second. ... The UPPER requires a table scan, ... it MySQL probably is using an index. ...
    (comp.lang.php)
  • Re: Does apache stop a script mid execution ?
    ... If the user calls a time consuming script and then stops or refreshes ... How does it relate to e.g. a script performing a large mysql query? ... 2.b) how the connection is set up. ... the server stops the script execution. ...
    (comp.lang.php)
  • Re: Does apache stop a script mid execution ?
    ... If the user calls a time consuming script and then stops or refreshes ... the way the client is implemented in the php mysql extension and 2.b) how the connection is set up. ... the server stops the script execution. ...
    (comp.lang.php)
  • Re: Cyrus IMAP with pam_mysql?
    ... FreeBSD, but if you check the startup script, all the parameters are ... Default log directories are in the default data directory, ... Makefile for mysql) They are changed in the above script prior to ... imaps auth sufficient pam_unix.so ...
    (freebsd-questions)