Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL Server Create Table
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00896117
Message ID:
00896140
Vues:
13
Hi Kevin,

You can create table this way but I would suggest to use textmerge for readability and check return value of SQLEXEC() for errors.
...
TEXT TO cString2 NOSHOW TEXTMERGE
CREATE TABLE distributors (
  did     DECIMAL(3) PRIMARY KEY,
  name    VARCHAR(40))
ENDTEXT
lnResult = SQLEXEC(nHandle, cString2)
IF lnResult < 0
  * ODBC errror - process it
  =AERROR(laErrors)
  ...	
ENDIF
>Im trying to create a table in the Northwind databse. Im not
>sure that this is the way to do this. If not, could someon
>point me in the right direction? Thanks
>
>
>CLEAR
>LOCAL nHandle, cString1, cString2
>
>cString1 = "DSN=northwind;uid='sa';pwd='';database=northwind"
>nHandle = SQLSTRINGCONNECT(cString1)
>
>cString2 = "CREATE TABLE distributors ( " +;
>  "did     DECIMAL(3) PRIMARY KEY," +;
>  "name    VARCHAR(40)"
>
>? SQLEXEC(nHandle, cString2)
>
>IF nHandle > 0
>  SQLDISCONNECT(nHandle)
>ENDIF
>
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform