I have installed MSDE as part of the FoxPro 7 install but I have not been
able to find how to create databases/tables. Any help would be appreciated
Thanks
Lee Mitchell - 08 Apr 2004 20:23 GMT
Hi TimK:
The easiest way to create a table is to use the File>New dialog off the VFP
system menu. You can choose to create either a table or a database.
You can also look for "Table Designer" and Database Designer" in the VFP
Help file.
I hope this helps.
This posting is provided "AS IS" with no warranties, and confers no rights.
Sincerely,
Microsoft FoxPro Technical Support
Lee Mitchell
*-- VFP8 HAS ARRIVED!! --*
Read about all the new features of VFP8 here:
http://www.universalthread.com/VisualFoxPro/News/VFP8Release.asp
Purchase VFP8 here:
http://shop.microsoft.com/Referral/Productinfo.asp?siteID=11518
Keep an eye on the product lifecycle for Visual FoxPro here:
http://support.microsoft.com/default.aspx?id=fh;[ln];lifeprodv
- VFP5 Mainstream Support retired June 30th, 2003
- VFP6 Mainstream Support retires Sept. 30th, 2003
>I have installed MSDE as part of the FoxPro 7 install but I have not been
>able to find how to create databases/tables. Any help would be appreciated
>Thanks
Fred Taylor - 09 Apr 2004 06:27 GMT
You can use SQL PassThru (SPT) and use the SQLEXEC() function from VFP:
ccs = "Driver={SQL Server};Server=office;Database=pubs;Uid=sa;Pwd=;"
nHandle = SQLSTRINGCONNECT(ccs)
nStat = SQLEXEC(nHandle,[CREATE DATABASE test])
nStat = SQLEXEC(nHandle,[USE test])
nStat = SQLEXEC(nHandle,[CREATE TABLE newtable (f1 varchar(10))])
nStat = SQLEXEC(nHandle,[INSERT INTO newtable (f1) VALUES ('test')])
nStat = SQLEXEC(nHandle,[INSERT INTO newtable (f1) VALUES ('test' again)])
nStat = SQLEXEC(nHandle,[INSERT INTO newtable (f1) VALUES ('do more')])
nStat = SQLEXEC(nHandle,[INSERT INTO newtable (f1) VALUES ('testing')])
nStat = SQLEXEC(nHandle,[SELECT * FROM newtable],mycursor)
nStat = SQLDISCONNECT(nHandle)
Fred
Microsoft Visual FoxPro MVP
> I have installed MSDE as part of the FoxPro 7 install but I have not been
> able to find how to create databases/tables. Any help would be appreciated
>
> Thanks