KiXforms Forum Index KiXforms
The Forum for the KiXforms Community
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 Quick Links 
Site News
Downloads
Documentation
Donations
Script Archive
Tracking Systems

connection parameter error

 
Post new topic   Reply to topic    KiXforms Forum Index -> Starters Code Clinic
View previous topic :: View next topic  
Author Message
JWood
KiXforms Dabbler
KiXforms Dabbler


Joined: 04 Sep 2008
Posts: 9
Location: Phoenix, AZ

PostPosted: Fri Sep 19, 2008 9:33 pm    Post subject: connection parameter error Reply with quote

I get the error "IDispatch pointers not allowed in expressions!" when I try to assign the parameter values in this script:
Code:
$objCn = CreateObject("ADODB.Connection")
$objCmd = CreateObject("ADODB.Command")

$strCnString = "Provider=SQLOLEDB;Server=***;Database=***;Integrated Security='SSPI';"

$objCn.Open($strCnString)
$objCmd.Activeconnection = $objCn
$objCmd.CommandText = "<name of SQL_SP>"
$objCmd.CommandType = 4  ;StoredProc
$objCmd.Parameters.Refresh
$objCmd(1) = 1   <-- ERROR ON THIS LINE
$objCmd(2) = 2

$objRs = $objCmd.Execute


The parameter values happen to be the integers 1 and 2 in that order...

Not sure what I am doing wrong here and this error seems to be common for all kinds of objects.
Back to top
View user's profile Send private message
Shawn
KiXforms Developer
KiXforms Developer


Joined: 22 Feb 2003
Posts: 1983
Location: Canada

PostPosted: Sun Sep 21, 2008 11:34 pm    Post subject: Reply with quote

That shortcut kinda COM syntax isn't supported by Kixtart. Have to find the long form and use that ...

My guess is your trying to set two parameters ? (idk), try this:

$objCmd.Parameters(1).Value = 1
$objCmd.Parameters(2).Value = 2

Just a wild guess here ...

-Shawn
Back to top
View user's profile Send private message
JWood
KiXforms Dabbler
KiXforms Dabbler


Joined: 04 Sep 2008
Posts: 9
Location: Phoenix, AZ

PostPosted: Mon Sep 22, 2008 2:49 pm    Post subject: Reply with quote

Don't be afraid of taking a wild guess. That did it!

Thanks for the help, again!!! Smile
Back to top
View user's profile Send private message
benny69
KiXforms Advocate
KiXforms Advocate


Joined: 30 Oct 2003
Posts: 567
Location: Lincoln, Ne

PostPosted: Mon Sep 22, 2008 5:10 pm    Post subject: Reply with quote

Yeah Shawn is like a Psychic looking into your script from the other side of the world. Laughing
_________________
Wait don't order yet,... get KiXforms Designer .NET 2.0 (Beta)
KiXforms Designer .NET 2.0 (Beta)
Back to top
View user's profile Send private message Send e-mail
Mart
KiXforms Regular
KiXforms Regular


Joined: 03 Oct 2005
Posts: 57
Location: Rotterdam - Netherlands

PostPosted: Tue Sep 23, 2008 8:51 am    Post subject: Reply with quote

LOL Very Happy

Yeah, he is the only one that has access to the $Form.CrystalBall attribute. Although you are also one of the big helpers around here Benny.

_________________
Mart

- He's chained forever to a world that's departed.....It's not enough, it's not enough - Sorrow by Pink Floyd.
Back to top
View user's profile Send private message
benny69
KiXforms Advocate
KiXforms Advocate


Joined: 30 Oct 2003
Posts: 567
Location: Lincoln, Ne

PostPosted: Tue Sep 23, 2008 3:03 pm    Post subject: Reply with quote

Mart your too kind, thanks.

I'm not sure how much help i have been for the past year or two, been kinda distracted with work, and btw, I think you Rock too.

_________________
Wait don't order yet,... get KiXforms Designer .NET 2.0 (Beta)
KiXforms Designer .NET 2.0 (Beta)
Back to top
View user's profile Send private message Send e-mail
Lonkero
KiXforms Devotee
KiXforms Devotee


Joined: 13 Mar 2003
Posts: 1022
Location: Espoo, Finland

PostPosted: Wed Sep 24, 2008 7:05 pm    Post subject: Reply with quote

who's helping?
it's illegal, stop it immediately!

_________________
Hammer
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
benny69
KiXforms Advocate
KiXforms Advocate


Joined: 30 Oct 2003
Posts: 567
Location: Lincoln, Ne

PostPosted: Wed Sep 24, 2008 7:27 pm    Post subject: Reply with quote

lol, the lonkinator strikes again. Laughing
_________________
Wait don't order yet,... get KiXforms Designer .NET 2.0 (Beta)
KiXforms Designer .NET 2.0 (Beta)
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    KiXforms Forum Index -> Starters Code Clinic All times are GMT
Page 1 of 1

 
Jump to:  
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
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group