Subject Re: BLOB TYPE 1 and asp (via ODBC)
Author Erik De Laet
Thanks for the answer ... so I presume selecting text is just as
easy as 'select this, thisblob from thisTable' ?
When I was reading Helen's book on Firebird so was mentioning a Blob-
id being returned. My Delphi programs handle these transparantly,
but I was just wondering whether select-statements via the ODBC
driver are returning the actual text blob or some id. And if they
are returing an id, what the next query should be.

Regarding the asp vs php: it's just not easy to overhaul a complete
running site from asp to php, especially when, like me, you have
hundreds and hundreds lines of asp routines and classes which
perform their task rather well.

Thanks



--- In firebird-support@yahoogroups.com, "Alan McDonald" <alan@...>
wrote:
>
> > I need to add a text blob column to one of my tables which is
being
> > accessed through asp-pages.
> >
> > I use the Firebird ODBC Driver v1.2.0 software.
> >
> > Are there any know issues with blobs accessed with asp pages ?
> >
> > I certainly need to display the data and if at all possible,
update
> > the data also (let the user write or paste some text, which is
than
> > stored inside the table).
> >
> > Any help would be greatly appreciated.
>
> there's no issues other than the normal 128k form submission
limitation
> which is IIS not FB (Dundas has a free upload component and
StateServer if
> you want to get fancy. After this you need to do multi-part
submission. You
> can use a parametised SP or parametised Query in the same way. I'd
recommend
> not using inline values to avoid inhection of SQL and exceptions
raised by
> string terminators. But I would highly recommend you look at PHP
instead.
> You can't run ASP on linux if ever want to move the code. ASP is a
dead
> technology now in lieu of asp.net etc.
>
>
> This code should give you some ideas. The blob field is a
adParamInput, type
> adVarChar, size 65535. After this size you need multipart
submissions.
>
>
> Set cmd = Server.CreateObject("ADODB.Command")
> Set cmd.ActiveConnection = DBConn
> DBConn.BeginTrans
> rsAdno = DBConn.Execute("SELECT OADNO FROM NEWADNO")
> cmd.CommandText = "ADVERTISEMENTS_I"
> cmd.CommandType = adCmdStoredProc
> cmd.Parameters.Append cmd.CreateParameter( "ID",
adInteger, adParamInput)
> cmd.Parameters("ID") = CLng(rsAdno("OADNO"))
> cmd.Parameters.Append cmd.CreateParameter( "LINKTOMEMBER",
adInteger,
> adParamInput )
> cmd.Parameters("LINKTOMEMBER") = CLng(Request.Cookies
("USERID"))
> cmd.Parameters.Append cmd.CreateParameter( "JOBTITLE",
adVarChar,
> adParamInput, 100 )
> cmd.Parameters("JOBTITLE") = MID(Request.Form
("jobtitle"),1,100)
> cmd.Parameters.Append cmd.CreateParameter
( "SHORTDESCRIPTION", adVarChar,
> adParamInput, 65535 )
> cmd.Parameters("SHORTDESCRIPTION") =
> SQLQuote(Request.Form("shortdescription"))
> cmd.Execute ,, adCmdStoredProc + adExecuteNoRecords
> ' Commit this transaction
> DBConn.CommitTrans
>
> Public Function SQLQuote(str)
> 'repeat all single quotes
> SQLQuote = Replace(str, "'", "''")
> End Function
>
> global.asa contains this code:
> Application("MainConn_ConnectionString")
= "DSN=ODBCDSNName;User
> Id=myuserid;PASSWORD=mypassword;"
> Application("MainConn_ConnectionTimeout") = 15
> Application("MainConn_CommandTimeout") = 30
> Application("MainConn_CursorLocation") = 3
> Application("MainConn_RuntimeUserName") = "myuserid"
> Application("MainConn_RuntimePassword")
= "mypassword"
>
> DBConn defined as:
> <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'),
> Application('MainConn_RuntimeUserName'),
> Application('MainConn_RuntimePassword'));
> </script>
>