Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL Scripts
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Miscellaneous
Thread ID:
00706584
Message ID:
01378901
Views:
34
>>How can I execute Sql Scripts in VFP? Is there an API or something ??
>>
>Silvio,
>
>From this thread it appears that you have access to the SQL Server Enterprise Manager. If so, the easiest way to do this would be through SQL-DMO. This is a COM object that allows you to do just about anything (including re-write) the Enterprise Manager can do. For example
oSQL = CREATEOBJECT('SQLDMO.SQLServer')
>oSQL.Connect(< server name >, < user name >, < password >)
>oDatabase = oSQL.DataBases(< Database name >)
>lccmnd = FILETOSTR(< SQL Script file >)
>oDatabase.ExecuteImmediate(lccmnd)
Additionally there are ExecuteWithResults and ExecuteWithResultsAndMessages (two of them)methods.

Hi George,

Is there any alternative to this method? I see http://msdn.microsoft.com/en-us/library/ms140570.aspx that it's not a recommended approach.
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform