|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
ODBC (OdbcJdbc.dll) error
... for the record:
In VFP8 when I try this: h = SQLSTRINGCONNECT([DRIVER={Firebird/InterBase(r) driver};UID=sysdba;PWD=masterkey;DBNAME=server_name:database_name]) SQLEXEC(h, [create database 'c:\test.gdb' user 'SYSDBA' password 'masterkey';]) I get the following error mdg. Connectivity error: Dynamic SQL Error SQL error code = -530 Cannot prepare a CREATE DATABASE/SCHEMA statement Question: Can I create a database with ODBC (OdbcJdbc.dll) or should I go for other ODBC driver ? Thank you. Last edited by goreXP : September 1st, 2003 at 12:48 PM. |
|
#2
|
||||
|
||||
|
VFP8 is visual fox pro ?
And what ODBC driver do you use ?
From where have you downloaded it ? Last edited by mariuz : September 1st, 2003 at 04:13 PM. |
|
#3
|
||||
|
||||
|
Re: VFP8 is visual fox pro ?
Quote:
Yes VFP8 = visual foxpro 8 ODBC driver from http://www.ibphoenix.com/ |
|
#4
|
|||
|
|||
|
You cannot create a database through ODBC because it needs an active connection to a database. At least the open source ODBC driver ( I use the same driver) . You can use API for this. Check
http://www.ibphoenix.com/main.nfs?a...LEDGEBASE;ID=52 But I didn't tried. Or you can use the CreateProcess() Win32 API call to run isql.exe with appropriate arguments. Or, the easy way, have a empty database (zipped is around 26k), copy it to the location you need, then connect to it . You can include the zipped empty database in your app/exe as resource in project manager. By the way, I use Firebird with VFP7. I've converted data for a data intensive application in our company, with many table corruption issues. I have 5 months now, without a SINGLE problem. Last edited by badukist : September 2nd, 2003 at 01:00 AM. |
|
#5
|
|||
|
|||
|
Salut
|
|
#6
|
|||
|
|||
|
I've checked API documentation and here is how you can create a database using API
DECLARE long isc_dsql_execute_immediate IN fbclient.dll string @ status_vector ; , integer @ db_handle ; , integer @ tr_handle ; , integer length ; , string statement ; , integer dialect ; , string @ xsqlda Sample code: status_vector = REPLICATE(CHR(0),80) db_handle = 0 tr_handle = 0 length = 0 statement = [CREATE DATABASE 'C:\TESTDATA.FDB' USER 'SYSDBA' PASSWORD 'masterkey' PAGE_SIZE 4096]+CHR(0) DIALECT = 3 XSQLDA=NULL ?isc_dsql_execute_immediate(status_vector, db_handle, tr_handle, length, statement, dialect, xsqlda) If the function return 0, then database is created. If the function return >0, then the error code and message can be retrieved using isc_sqlcode() and isc_sql_interprete() API functions |
|
#7
|
||||
|
||||
|
... this is the answer.
Thank you badukist |
|
#8
|
|||
|
|||
|
Do you use in your remote views in your VFP7 application? I want to create a remote view through the view designer when I try to add a table a get the list of tables but when I select one of them and then I click on ADD VFP gives me an error
. Do you know anything about it? tahnks for your help.Skysurfer Quote:
|
|
#9
|
||||
|
||||
|
Quote:
You have to check the "All User Tables" check box on the bottom of the "Open" window. Doru
__________________
Romania it's a beautiful country ... too bad that it's populated with ... peoples! |
![]() |
| Viewing: Dev Shed Forums > Databases > Firebird SQL Development > ODBC (OdbcJdbc.dll) |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|