Page 1 of 1 1
Topic Options
#90361 - 2002-12-05 02:00 PM IDispatch error
Frode S. Hansen Offline
Lurker

Registered: 2002-12-05
Posts: 2
Loc: Frederiksborg Amt
I'm trying to implement automated logging of some hardware information to a MSSQL DB at logontime but i keep getting the errormessage "Script error: IDispatch pointers not allowed in expressions!" in both v. 4.11 and v. 4.12. The script looks like this:
$Komm = "(a string containing a call to stored procedure wit parameters)"

$SQLConn = CreateObject("ADODB.Connection")
$SQLConn.ConnectionString = "Driver={SQL Server};Provider=SQLOLEDB;Server=xxxx;Database=nnnn;Trusted_Connection=Yes"
$SQLConn.ConnectionTimeout = 30
$SQLConn.Cursorlocation=3
$SQLConn.Open
$SQLConn.Execute($Komm)

The SQL-orders contained in $Kom are executed ok on the server but the script terminates, allowing me only one SQL-order in the last line for the script.

I'll be gratefull for any help!
_________________________
I never visited a more inspiring BBS than this.

Top
#90362 - 2002-12-05 02:04 PM Re: IDispatch error
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
Just a wild guess here :

$SQLConn.Open
$SQLConn.Execute($Komm)

try it with :

$ = $SQLConn.Open
$ = $SQLConn.Execute($Komm)

[ 05. December 2002, 14:05: Message edited by: jpols ]
_________________________



Top
#90363 - 2002-12-05 02:13 PM Re: IDispatch error
Frode S. Hansen Offline
Lurker

Registered: 2002-12-05
Posts: 2
Loc: Frederiksborg Amt
You're certainly wild at guessing!
This line did the trick:

$ = $SQLConn.Execute($Komm)

You've saved the day for me!
Thanks a lot.
_________________________
I never visited a more inspiring BBS than this.

Top
#90364 - 2002-12-05 02:18 PM Re: IDispatch error
Waltz Offline
Seasoned Scripter

Registered: 2002-08-01
Posts: 485
Loc: Waterloo, Ontario, Canada
...another wild guess?
imho, assigning to $ is flirting with danger...better to assign to something like $nul...
_________________________
We all live in a Yellow Subroutine...

Top
#90365 - 2002-12-05 02:25 PM Re: IDispatch error
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
Well , no danger at all if you always use $$ for referencing Dollar characters [Big Grin]
_________________________



Top
#90366 - 2002-12-05 02:30 PM Re: IDispatch error
Waltz Offline
Seasoned Scripter

Registered: 2002-08-01
Posts: 485
Loc: Waterloo, Ontario, Canada
...unless they are Canadian Dollars... [Wink]
_________________________
We all live in a Yellow Subroutine...

Top
#90367 - 2002-12-05 03:22 PM Re: IDispatch error
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
Please take a look at the DB UDFs in the UDF Forum, e.g. DBConnOpen, DBConnclose, DBExecuteSQL. they should do what you try to accomplish.

Additionally, the DB connectivity requires KiXtart 4.12+ as there is a bug in the COM handler of KiXtart 4.10/4.11

[ 06. December 2002, 15:57: Message edited by: sealeopard ]
_________________________
There are two types of vessels, submarines and targets.

Top
#90368 - 2002-12-05 09:34 PM Re: IDispatch error
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
jens, isn't that 4.10>you need>4.11?

I thought it was working fine in 4.02...
_________________________
!

download KiXnet

Top
#90369 - 2002-12-06 03:58 PM Re: IDispatch error
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
Nope, they require KiXtart 4.12+. They might work under 4.02, but I do not guarantee it anymore as my target platform is KiXtart 4.12 and I only test for this version.
_________________________
There are two types of vessels, submarines and targets.

Top
#90370 - 2002-12-06 04:09 PM Re: IDispatch error
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
[Razz]

so, require is different than need?
_________________________
!

download KiXnet

Top
#90371 - 2002-12-06 04:16 PM Re: IDispatch error
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
I can promise you that DBGetRecordSet will no longer work once I've updated that part of code because it will return a multi-dimensional array. Thus it will require KiXtart 4.12 which will mean that it is pointless to have the other DB routines work under KiXtart 4.02 as they are all complimentary to each other.

I've already added a header field to my UDFs denoting the minimum KiXtart version required (if it works under older versions, then you're lucky, but I will not guarantee it).
_________________________
There are two types of vessels, submarines and targets.

Top
Page 1 of 1 1


Moderator:  Shawn, ShaneEP, Ruud van Velsen, Arend_, Jochen, Radimus, Glenn Barnas, Allen, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 657 anonymous users online.
Newest Members
M_Moore, BeeEm, min_seow, Audio, Hoschi
17883 Registered Users

Generated in 0.067 seconds in which 0.031 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org