Firebird SQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesFirebird SQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old September 1st, 2003, 12:37 PM
goreXP's Avatar
goreXP goreXP is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Location: Bucharest
Posts: 72 goreXP User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 10 m 10 sec
Reputation Power: 6
Send a message via MSN to goreXP Send a message via Yahoo to goreXP
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.

Reply With Quote
  #2  
Old September 1st, 2003, 03:45 PM
mariuz's Avatar
mariuz mariuz is offline
Bug Hunter
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2003
Location: Transylvania (Romania)
Posts: 274 mariuz User rank is Corporal (100 - 500 Reputation Level)mariuz User rank is Corporal (100 - 500 Reputation Level)mariuz User rank is Corporal (100 - 500 Reputation Level)mariuz User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 20 h 12 m 34 sec
Reputation Power: 9
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.

Reply With Quote
  #3  
Old September 2nd, 2003, 12:33 AM
goreXP's Avatar
goreXP goreXP is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Location: Bucharest
Posts: 72 goreXP User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 10 m 10 sec
Reputation Power: 6
Send a message via MSN to goreXP Send a message via Yahoo to goreXP
Re: VFP8 is visual fox pro ?

Quote:
Originally posted by mariuz
And what ODBC driver do you use ?
From where have you downloaded it ?


Yes VFP8 = visual foxpro 8
ODBC driver from http://www.ibphoenix.com/

Reply With Quote
  #4  
Old September 2nd, 2003, 12:53 AM
badukist badukist is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Posts: 62 badukist User rank is Corporal (100 - 500 Reputation Level)badukist User rank is Corporal (100 - 500 Reputation Level)badukist User rank is Corporal (100 - 500 Reputation Level)badukist User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 13 h 3 m 18 sec
Reputation Power: 7
Send a message via Yahoo to badukist
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.

Reply With Quote
  #5  
Old September 2nd, 2003, 03:14 AM
badukist badukist is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Posts: 62 badukist User rank is Corporal (100 - 500 Reputation Level)badukist User rank is Corporal (100 - 500 Reputation Level)badukist User rank is Corporal (100 - 500 Reputation Level)badukist User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 13 h 3 m 18 sec
Reputation Power: 7
Send a message via Yahoo to badukist
Salut

Reply With Quote
  #6  
Old September 22nd, 2003, 04:55 AM
badukist badukist is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Posts: 62 badukist User rank is Corporal (100 - 500 Reputation Level)badukist User rank is Corporal (100 - 500 Reputation Level)badukist User rank is Corporal (100 - 500 Reputation Level)badukist User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 13 h 3 m 18 sec
Reputation Power: 7
Send a message via Yahoo to badukist
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

Reply With Quote
  #7  
Old September 23rd, 2003, 09:35 AM
goreXP's Avatar
goreXP goreXP is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Location: Bucharest
Posts: 72 goreXP User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 10 m 10 sec
Reputation Power: 6
Send a message via MSN to goreXP Send a message via Yahoo to goreXP
Thumbs up Yes ...

... this is the answer.

Thank you badukist

Reply With Quote
  #8  
Old March 8th, 2006, 05:34 AM
skysurfer skysurfer is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2006
Posts: 2 skysurfer User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 28 m 8 sec
Reputation Power: 0
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:
Originally Posted by badukist
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
URL
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.

Reply With Quote
  #9  
Old March 8th, 2006, 03:17 PM
goreXP's Avatar
goreXP goreXP is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Location: Bucharest
Posts: 72 goreXP User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 10 m 10 sec
Reputation Power: 6
Send a message via MSN to goreXP Send a message via Yahoo to goreXP
Quote:
Originally Posted by skysurfer
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


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!

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesFirebird SQL Development > ODBC (OdbcJdbc.dll)


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway