Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How I create a Database in SQL-server form VFP

Status
Not open for further replies.

Xaplytz

Programmer
Jun 26, 2000
79
US
How I create a Database in SQL-Server form VFP
I tried with SQLexec() and doesn’t work
I would like to know if some way to do it
Thank.

[sig][/sig]
 
Of course, you should use SQLExec. However, you should NOT use VFP commands for this. In other words
SQLExec("CREATE DATABASE ...")
will not work.
SQL Server have its own language and commands, stored procedures. You should use them to create databases and tables on SQL Server programmatically. Better find some good book on SQL Server commands.
[sig]<p>Vlad Grynchyshyn<br><a href=mailto:vgryn@softserve.lviv.ua>vgryn@softserve.lviv.ua</a><br>[/sig]
 
I Know How create a database, tables from the query analyzer and save them in a script file an run it in a batch.

But what I meant, was how using just VFP if it’s possible create a database, I guess it is because the VFP has a wizard that upload the fox database on SQL-server, but how I could do the same for my owns installations.


[sig][/sig]
 
FWIW, if you are using VFP6, the source code for MOST of the builders and wizards are included in a file named XSource.zip. I believe the Upsizing wizard is among the included, if you want to attempt to decifer it. :) [sig]<p>Jon Hawkins<br><a href=mailto: jonscott8@yahoo.com> jonscott8@yahoo.com</a><br><a href= > </a><br>Focus on the solution....Not the problem.[/sig]
 
How I create a Database in SQL-Server form VFP
I tried with SQLexec() and doesn’t work


I cranked up VFP, used SQLSTRINGCONNECT() to connect to my SQL Server 7 as an sa-equivalent, and issued the following command:

[tt]sqlexec(hConnection, &quot;create database mytemp&quot;)[/tt]

A database named mytemp was successfully created in SQL Server. No problems.
[sig]<p>Robert Bradley<br><a href=mailto: > </a><br><a href= - Visual FoxPro Development</a><br> [/sig]
 
Robert Bradley
Thank is working ok

I had tried with SQLconnect()+SQLexe() before and didn’t create the database, but with SQLstringconnect it does
Even I don’t need have a database in VFP to get the connection.

Thank a lot




[sig][/sig]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top