Subject Re: Can I use FB Embedded with VB6?
Author Javier Soques
Answer at the end...

--- In firebird-support@yahoogroups.com, "mt_headed99"
<mt_headed99@...> wrote:
>
> Greetings!
>
> I have a legacy app that I need to keep upgrading while I work on its
> successor... I'm planning to move to all open-source and
> cross-platform; at this point I'm actually favoring Python. But
> meanwhile, I need to make the thing database-aware.
>
> I know from experience that, if anyone responds to this message, 95%
> of the responses will simply tell me not to use VB6. I'm working on
> that...
>
> I've been trying to RTFM on this, but I can't seem to find an answer -
> VB6 won't let me create a reference to fbembed/fbclient.dll; the ODBC
> driver on the Firebird website appears to be .NET only... am I out of
> luck? Or can I use the Microsoft ADO ver 2.8 that I _do_ have a
> reference for, and in that case what sort of connection string do I
> use? (And how the heck does the embedded server run if I can't
> reference the DLL?)
>
> I'd prefer to use the embedded server 'cause it's so tiny, but it's
> not a deal-breaker if I can't. If I can't, however, would someone
> please help me construct a working connection string for CS or SS? I
> can't find any working examples for VB6, and I'm flummoxed trying to
> translate the .NET examples.
>
> Many thanks, sincerely -
> Stuck in the Dark Ages
>

Here is what I did, downloaded latest version of FB Embedded and ODBC
driver. I assume you know how to use ADO so here is an example
connection string:

Provider=MSDASQL.1;Persist Security Info=False;Extended
Properties="DSN=MyERP;Driver=Firebird/InterBase(r)
driver;Dbname=C:\data\firebird\MYERP.FDB;CHARSET=NONE;UID=SYSDBA;Role=admin;Client=C:\fbembedded\fbembed.dll"

If you don't put the full path to the client DLL (fbembed.dll) then
your VB6 app exe has to be in the same directory where you extracted
the FB embedded Zip, or put fbembed.dll in your search path (haven't
tried that though).

Example code:

Private Sub Command1_Click()

Dim conn As ADODB.Connection
Dim rs As ADODB.Recordset

Set conn = New ADODB.Connection
conn.ConnectionString = "Provider=MSDASQL.1;Persist Security
Info=False;Extended Properties='DSN=MyERP;Driver=Firebird/InterBase(r)
driver;Dbname=C:\data\firebird\MYERP.FDB;CHARSET=NONE;UID=SYSDBA;Role=admin;Client=C:\fbembedded\fbembed.dll'"
conn.Open

Set rs = New ADODB.Recordset

Set rs = conn.OpenSchema(adSchemaTables) 'show all tables in the grid

Set DataGrid1.DataSource = rs

End Sub

That`s all there is to it.

HTH
Javier