jennyflower
Programmer
Hi, I have installed MS SQL Express and have set up the sa user but I cannot get the user to be able to create a database in SQL Server from VFP. I can create the database within SQL Server management tools however. The code I am using is:
lnconn = SQLSTRINGCONNECT("dsn=mseurospec;UID=sa;PWD=password;")
IF lnconn < 0 THEN
MESSAGEBOX("Could not Connect to MSSQL Database on localhost", 0, "WARNING!")
ELSE
lnresult = SQLEXEC(lnconn, "CREATE DATABASE eurospec")
IF lnresult < 0 THEN
MESSAGEBOX("Could not create database 'eurospec' on localhost")
ENDIF
ENDIF
SQLDISCONNECT(0)
I can connect OK but then I just a message saying I couldn't create the database.
Thanks
lnconn = SQLSTRINGCONNECT("dsn=mseurospec;UID=sa;PWD=password;")
IF lnconn < 0 THEN
MESSAGEBOX("Could not Connect to MSSQL Database on localhost", 0, "WARNING!")
ELSE
lnresult = SQLEXEC(lnconn, "CREATE DATABASE eurospec")
IF lnresult < 0 THEN
MESSAGEBOX("Could not create database 'eurospec' on localhost")
ENDIF
ENDIF
SQLDISCONNECT(0)
I can connect OK but then I just a message saying I couldn't create the database.
Thanks