stormlolz Posted January 11, 2017 Share Posted January 11, 2017 Hello, I need help for my script... I'm lost.. I make a SQL request on my Acces DB, ok it's running and my result is $RS1 $query_logo_niveau = "SELECT logo.niveau FROM logo where logo.num_col = '" & Guictrlread($numcol) & "';" $AdoCon2 = ObjCreate("ADODB.Recordset") $AdoCon2.ActiveConnection = $AdoCon $AdoCon2.Open($query_logo_niveau) $RS2 = $AdoCon2.getstring() MsgBox(0, "result $RS2", $RS2) FileWrite("rs2.txt", $RS2) But my result $RS1 are : in txt file : " 6 5 7 3 2 1" in msgbox : (see png join) I want to set each different value of my results query in string/variable how can i do ? Thank you so much Sorry for my english rs2.txt Link to comment Share on other sites More sharing options...
Subz Posted January 11, 2017 Share Posted January 11, 2017 Something like this maybe? #include <Array.au3> $query_logo_niveau = "SELECT logo.niveau FROM logo where logo.num_col = '" & Guictrlread($numcol) & "';" $AdoCon2 = ObjCreate("ADODB.Recordset") $AdoCon2.ActiveConnection = $AdoCon $AdoCon2.Open($query_logo_niveau) $RS2 = $AdoCon2.getstring() $aRS2 = StringSplit($RS2, @CR) _ArrayDisplay($aRS2) stormlolz 1 Link to comment Share on other sites More sharing options...
stormlolz Posted January 11, 2017 Author Share Posted January 11, 2017 Hello, Thank you for the answer And I have my results with : $aRS2[1] $aRS2[2] ... ? What it's the row 0, $aRS2[0] which have value 7 ? Link to comment Share on other sites More sharing options...
Subz Posted January 11, 2017 Share Posted January 11, 2017 The number of rows, so you can then use it in something like For $x = 1 To $aRS2[0] ConsoleWrite($aRS2[$x] & @CRLF) Next Link to comment Share on other sites More sharing options...
Subz Posted January 11, 2017 Share Posted January 11, 2017 You probably should use, StringStripWS with Flag 7 to remove whitespace at the beginning and end of the string, so that you don't have the blank last row. $aRS2 = StringSplit(StringStripWS($RS2, 7), @CR) Link to comment Share on other sites More sharing options...
stormlolz Posted January 11, 2017 Author Share Posted January 11, 2017 Thank you I have my result without space I don't know how work Consolewrite / Consoleread, but thank you so ! Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now