 |
TonDiening GURU

Joined: 26 Jul 2001 Posts: 1958 Location: Canada
|
Posted: Tue Dec 05, 2006 5:44 pm
[1.19] %trim and comobject |
Create a simple access database called myaccess.mdb with table lore a column Description and a column Result.
Populate the first row with Description=bif and Result=Bof.
retrieve bif
| Code: |
#alias Retrieve {
#VARIABLE query {Select * From lore where Description = '%lower( %1)'}
#VARIABLE rs %comcreate( "ADODB.Recordset")
#VAR ConnSTr "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=myaccess.mdb"
#CALL @rs.Open(@query, @ConnStr, 2, 2)
#IF (@rs.eof!=-1) {
#VAR temp @rs.Fields("Result").Value
#IF (%len( %trim(@temp))>1) {#SH Trim temp variable %trim(@temp) which works}
#IF (%len( %trim(@rs.Fields("Result").Value))>1) {#SH Trim comobject variable %trim(@rs.Fields("Result").Value) which does not work as it returns a half parsed thing}
} {
#SH not found %1
}
#CALL @rs.close
#VARIABLE rs ""
}
|
Outputs:
Trim temp variable Bof which works
Trim comobject variable <COMObject>(Result which does not work as it returns a half parsed thing
Variables:
query (String) Select * From lore where Description = 'bif'
rs (Literal)
ConnSTr (Literal) Provider=Microsoft.Jet.OLEDB.4.0;Data Source=myaccess.mdb
temp (Auto) Bof |
|
|
|
 |
Zugg MASTER

Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Tue Dec 05, 2006 10:10 pm |
Looks like it was a general issue with COM variables and function calls, so while I didn't have the time to recreate your steps, I think I have this fixed for 1.20 so give it another try when it's released later this week.
|
|
|
|
 |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|