Subject Re: Repost: connecting to embedded server
Author Dorin Vasilescu
Yes, is possible, but the approach needs an entry in registry for the
DSN and the full path for ODBC libraries and fbclient.dll
I use ODBC without registering, from application folder
Some sample code
PROCEDURE setDSN
LPARAMETERS cDSN,cServerName,cDBName, cDLLPath, cRole
*cDSN entry in ODBC DSN
*cServerName server, name or IP
*cDBName database
*cDLLPath path to DLLs folder
*cRole user role

#DEFINE HKEY_CURRENT_USER -2147483647
#DEFINE SUB_KEY 'Software\ODBC\ODBC.INI\'

IF TYPE('cRole') <> 'C'
cRole = 'appuser'
ENDIF

oReg = NEWOBJECT('registry','registry.prg')

WITH oReg as registry OF Registry.prg
.writeRegistryString(HKEY_CURRENT_USER, SUB_KEY + cDSN, 'Driver',
cDLLPath+'OdbcJdbc.dll' ,.t.)
.writeRegistryString(HKEY_CURRENT_USER, SUB_KEY + cDSN, 'Dbname',
cServerName+":"+cDBName, .t.)
.writeRegistryString(HKEY_CURRENT_USER, SUB_KEY + cDSN, 'User', ' ',
.t.)
IF LOWER(oApp.cUserName) = 'administrator'
.writeRegistryString(HKEY_CURRENT_USER, SUB_KEY + cDSN, 'Role',
'appadmin', .t.)
ELSE
.writeRegistryString(HKEY_CURRENT_USER, SUB_KEY + cDSN, 'Role',
'appuser', .t.)
ENDIF
.writeRegistryString(HKEY_CURRENT_USER, SUB_KEY + cDSN,
'CharacterSet','NONE',.t.)
.writeRegistryString(HKEY_CURRENT_USER, SUB_KEY + cDSN, 'Client',
cDLLPath + 'fbclient.dll' ,.t.)
.writeRegistryString(HKEY_CURRENT_USER, SUB_KEY + cDSN,
'JdbcDriver','IscDbc',.t.)
.writeRegistryString(HKEY_CURRENT_USER, SUB_KEY + cDSN,
'ReadOnly','N', .t.)
.writeRegistryString(HKEY_CURRENT_USER, SUB_KEY + cDSN, 'NoWait'
,'Y', .t.)
.writeRegistryString(HKEY_CURRENT_USER, SUB_KEY + cDSN, 'Dialect',
'3', .t.)
.writeRegistryString(HKEY_CURRENT_USER, SUB_KEY + cDSN,
'QuotedIdentifier','N',.t.)
.writeRegistryString(HKEY_CURRENT_USER, SUB_KEY + cDSN, 'Password','
',.t.)
.writeRegistryString(HKEY_CURRENT_USER, SUB_KEY + cDSN,
'SensitiveIdentifier','Y',.t.)
.writeRegistryString(HKEY_CURRENT_USER, SUB_KEY + cDSN,
'AutoQuotedIdentifier','N',.t.)
ENDWITH
ENDPROC && setDSN



--- In firebird-support@yahoogroups.com, "p_lerner" <plerner@s...> wrote:
> I'm developing with Visual fox pro. I was wondering if I can make a
> connection to the embedded server without installing ODBC drivers.
>
> Will calling to IBPhoenix's ODBC driver functions directly work?
> Has anyone done this before?
>
> Where can I get info about this? I have already been reading about
> ODBC driver, but I can't find docs about functions implemented and
> how to call them.
>
> How can I do that? I've never done this since I always connected
> using FoxPro's "sqlconnect()" function, wich only works if there's a
> ODBC driver installed on Windows.
>
> My goal is to deploy a small application wich may use the embedded.
> But I don't want users to install an ODBC driver.
>
> Thank's
>
> Pablo