Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to create Firebird database and connection automatic
Message
De
26/01/2005 14:58:13
 
 
À
26/01/2005 01:34:54
Dorin Vasilescu
ALL Trans Romania
Arad, Roumanie
Information générale
Forum:
Visual FoxPro
Catégorie:
Client/serveur
Divers
Thread ID:
00980204
Message ID:
00980913
Vues:
19
I tried your program. The ODBC login prompt appears and after filling it
sqlstringconnect() returns error

Connectivity error: I/O error for file "C:\T"
Error while trying to open file
Access is denied.

C:\T is VFP default directory.

any idea how to run this code ?

My code:
oFB = NEWOBJECT('firebird', 'firebird.prg')
oFB.client_dll="C:\Program Files\Firebird\Firebird_1_5\bin\fbclient.dll"

IF !oFB.SrvAttach(.T.) 
  MESSAGEBOX('Firebird server not running'+ CHR(13)+ ofb.output )
  RETURN .f.
  ENDIF
   
IF !FILE('c:\demo.fdb') AND !oFB.CreateDB('c:\demo.fdb')
   MESSAGEBOX('Database creation failed '+ CHR(13)+ ofb.output )
   RETURN .f.
   ENDIF
 
RELEASE oFB
SQLSETPROP(0,"DispLogin",3)
  
  cConnStr=  "DRIVER=Firebird/InterBase(r) driver; UID=SYSDBA; PWD=masterkey; " + ;
   "DBNAME=localhost:c:\demo.fdb"

  
lnConnHandle = sqlstringconnect( cconnstr )

IF lnConnHandle <= 0
  AERROR( laerror )
  _cliptext = laerror[1,2]
  MESSAGEBOX( laerror[1,2] )
  RETURN .f.
  ENDIF
Andrus
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform