Subject | RE: [firebird-support] web access via ODBC to Firebird |
---|---|
Author | Alan McDonald |
Post date | 2003-10-24T08:03Z |
> Hi,Erik,
>
> I am trying to change my .asp web code to access a Firebird database in
> stead of the Access database it uses now.
>
> Is there a good white paper on accessing Firebird through ODBC on
> web pages ?
>
> I get all sorts of strange errors, like odbc errors when testing the BOF
> and EOF markers on a recordset. Do I need to set transactions or so ?
>
> Thanks for any help you might provide me.
>
This is a typical global.asa file or whatever you like to use with a typical
connection setup
<SCRIPT LANGUAGE='VBScript' RUNAT='Server'>
Sub Session_OnStart
End Sub
</SCRIPT>
<SCRIPT LANGUAGE=VBScript RUNAT=Server>
Sub Application_OnStart
Application("MainConn_ConnectionString") = "DRIVER={Gemini InterBase ODBC
Driver
2.0};PROTOCOL=2;SERVER=serverordomainname/port;DATABASE=drive:\path\filename
.gdb;VERSION=6;DIALECT=3;OPTIONS=256;UID=userid;PWD=password;"
Application("MainConn_ConnectionTimeout") = 15
Application("MainConn_CommandTimeout") = 30
Application("MainConn_CursorLocation") = 3
End Sub
</SCRIPT>
If you are using another ODBC driver you may need to use a DSN but make sure
you use tcp naming convention i.e. servername:drive:\path\filename.gdb, do
NOT use local path.
And this is a connection setup:
<script LANGUAGE="JScript" RUNAT="Server">
var DBConn = Server.CreateObject('ADODB.Connection');
DBConn.ConnectionTimeout = Application('MainConn_ConnectionTimeout');
DBConn.CommandTimeout = Application('MainConn_CommandTimeout');
DBConn.CursorLocation = Application('MainConn_CursorLocation');
DBConn.Open(Application('MainConn_ConnectionString'));
</script>
You don't need transactions unless you need transactions .. :-)
I see no errors with EOF/BOF markers.
Alan