Sign in to follow this  
Followers 0
sirWimelef

absurd problem with sql

3 posts in this topic

i working on a script that take info froma MS SQL server 2k and tranfer it to a excel object

the problem is in this simple code:

$sqlCon = ObjCreate("ADODB.Connection")
$sqlCon.Open("Driver={SQL Server};Server=192.9.200.6;Database=MVXJDTA;Uid=Test;Pwd=tesT;")
$RS=$sqlCon.EXECUTE("SELECT KPPCDT,* FROM MVXJDTA.MCCOMA WHERE  KPVASE in ('604AA000001') AND KPPCDT=20031215")
MsgBox(1,"",$RS.fieldS("KPPCDT").VALUE)

the text that appears on the msgbox is "20031216"

i dont find logical on this,I'm saying explicitly that should be KPPCDT=20031215, and i take that field again on the msg box

if i execute these same sql on a querys program the field is correct

Share this post


Link to post
Share on other sites



What about

$sqlCon = ObjCreate("ADODB.Connection")
$sqlCon.Open("Driver={SQL Server};Server=192.9.200.6;Database=MVXJDTA;Uid=Test;Pwd=tesT;")
$RS=$sqlCon.EXECUTE("SELECT * FROM MVXJDTA.MCCOMA WHERE  KPVASE in ('604AA000001') AND KPPCDT=20031215")
MsgBox(1,"",$RS.fieldS("KPPCDT").VALUE)

An example of the contents of the database might help too :)

Cheers,

Brett

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

well, i solved it updating to the last version of autoit

Edited by sirWimelef

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0