p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


  Return to Index  

asp_components thread: MEMO FIELD type, ASP, ADO and Windows Scripting


Message #1 by "Ernie Margallo" <ernie.margallo@s...> on Fri, 10 May 2002 13:37:26 -0400
This is a multi-part message in MIME format.

------=_NextPart_000_0015_01C1F827.D27A2DC0
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Why am I getting EMPTY or NULL data from a database (MSAccess) field 
element defined with MEMO FIELD as data type when RecordSet is accessed 
via a MS Windows Scripting component?

Background:

I have an application developed in ASP and ADO and I am trying to make a 
component containing all the access (input & output) to the database 
using Microsoft Windows Scripting, (eventually to be converted to VBasic 
component). I declared the RecordSet in the ASP program and passed it as 
a Parameter to the component. The approach works and the ASP program can 
access all the table elements except those that are Memo field types.

Here are the partial coding of myASP program and myCOMPONENT. ADO 
connection is established in myASP and passed on to myCOMPONENT as a 
property. myRECORDSET is declared in myASP and used as a component 
parameter. The database table, ie. MSAccess table, has a numeric field1, 
a character field2 and a memofield  field3. Both the numeric and 
character fields are ok. The memo field displays empty or null. This is 
NOT the case when the database is accessed within myASP program.


Sample Codes:

'     Partial CODES IN THE myASP PROGRAM:
.

dim objConn
Set objConn =3D Server.CreateObject("ADODB.Connection")
ObjConn.Open "FileDSN=3DmyDATABASE"

dim myDATABASE, myRECORDSET,  myERRORCODE
Set myDATABASE =3D Server.CreateObject("MYCOMPONENT.WSC")
myDATABASE.pobjConn =3D objConn

myERRORCODE =3D myDATABASE.GetRecordSet("myRECORDSET")
.
.
If myRECORDSET.EOF then
       <%=3D "I can use the EOF method")%>
Else
    <%=3D "I can acces this field" & myRECORDSET("field1") & " content 
of numeric field1 displays correctly%>
    <%=3D "I can acces this field" & myRECORDSET("field2") & " content 
of character field2 displays correctly%>
    <%=3D "I can acces this memofield" & myRECORDSET("field3") & " but 
the memo field3 displays empty%>
End if
myRECORDSET.Close
Set myRECORDSET =3D nothing
.
.
    Partial CODES IN myCOMPONENT:
.
.
 <property name=3D"pobjConn">
  <put/>
 </property>
.
.
dim pobjConn
.
.
function put_pobjConn(newValue)
 pobjConn =3D newValue
end function
.
.
Function GetRecordSet(myRECORDSET)

dim objConn
Set objConn =3D Server.CreateObject("ADODB.Connection
ObjConn.Open "FileDSN=3DDemo

Set myRECORDSET =3D Server.CreateObject("ADODB.RecordSet")
dim mySQL
mySQL =3D "Select * FROM myTable)
myRECORDSET.Open mySQL, objConn

End function
.
.
.



  Return to Index