Reallt Posted September 8, 2006 Posted September 8, 2006 I have a script that opens my database and collects infromation, but I havent been able to figure out how to send that information. Here is the code I have so far: ___________________________________________________________________ Local $oRS Local $oConn Local $oProviderGroupID $oConn = ObjCreate ("ADODB.Connection") $oRS = ObjCreate ("ADODB.Recordset") $oConn.Open ("Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;User ID=user;Data Source=datasource") $oProviderGroupID = ObjName ("ProviderGroupID") $oRS.Open("SELECT DMisProviderGroup.ProviderGroupID FROM DMisProviderGroup WHERE DMisProviderGroup.Active= 'Y' AND LEFT(DMisProviderGroup.ProviderGroupID,3)IN ('LC.','MD.','UA.') AND DMisProviderGroup.ProviderGroupID NOT IN ('LC.PSYCH','LC.PSYKLR','LC.PSYMAD','LC.PSYMID','LC.PSYNEE','LC.PSYOSH')AND SUBSTRING(DMisProviderGroup.ProviderGroupID,4,3) <> 'LAB' ", $oConn, 1, 3) WinWaitActive ("MIS") For $iIndex = 1 To $oRS.RecordCount SEND ($oProviderGroupID) SEND ("{ENTER}") $oRS.MoveNext Next $oConn.Close $oConn = 0 ___________________________________________________________________ I know I am getting records, I can do a record count and it returns a value of 93 and that is correct. How do I print each record? Thanks!!!
lod3n Posted September 8, 2006 Posted September 8, 2006 (edited) What are you SENDing to? Notepad? Wouldn't you rather save the information somewhere? But I think you want to change SEND ($oProviderGroupID) to SEND ($oRS.Fields(1).value) Edited September 8, 2006 by lod3n [font="Fixedsys"][list][*]All of my AutoIt Example Scripts[*]http://saneasylum.com[/list][/font]
Reallt Posted September 8, 2006 Author Posted September 8, 2006 I am using this scrip to help an admin assistant in filling out a form. Right now we have 93 different clinics and they change all the time. This script will be grabbing the clinics from an up-to-date database, then filling in an input box on the form. I changed the line as was suggested; however I received the following error: Line 27 (File"C"\filelocation\script.AU3) SEND ($oRS.Fields(1).value) SEND ($oRS.Fields(1)^ERROR Error: The requested action with this object has failed. Thanks for the help!
lod3n Posted September 8, 2006 Posted September 8, 2006 Oops! SEND ($oRS.Fields(0).value) [font="Fixedsys"][list][*]All of my AutoIt Example Scripts[*]http://saneasylum.com[/list][/font]
Reallt Posted September 8, 2006 Author Posted September 8, 2006 That works perfectly! Thank you very much!
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