Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Create Database
Message
 
To
All
General information
Forum:
Visual FoxPro
Category:
Client/server
Title:
Create Database
Miscellaneous
Thread ID:
00895908
Message ID:
00895908
Views:
53
Is it possible to create a database within MSSQL-server from a VFP-client by for example using SQLEXEC()-function. I have tried the following with no success:
gcMydatabaseName="MyName"
lcMap="\\myServer\mySQLDataFiles"
lcCreateDatabaseString1="CREATE DATABASE "+gcMydatabaseName+" ON PRIMARY (NAME = "+gcMydatabaseName+"_Data,"+;
"FILENAME = "+lcMap+gcMydatabaseName+"_Data.mdf',"+;
"SIZE=20MB,MAXSIZE=100MB,FILEGROWTH=10MB)"
lcCreateDatabaseString2= " LOG ON (NAME = "+gcMydatabaseName+;
"_Log,FILENAME = "+lcMap+gcMydatabaseName+"_Log.ldf',"+;
"SIZE=5MB,MAXSIZE=15MB,FILEGROWTH=1MB)"
lnTest1=SQLEXEC(gnConSQL,lcCreateDatabaseString1)
? lnTest1 returns -1
lnTest2=SQLEXEC(gnConSQL,lcCreateDatabaseString2)
? lnTest2 returns -1
gnConSQL handle is created by connecting to the SQL-server master database and also tested by connecting to the SQL-server without any database specification.
Next
Reply
Map
View

Click here to load this message in the networking platform