Jump to content


Photo

Error with DBA script


  • Please log in to reply
1 reply to this topic

#1 eawedat

eawedat
  • Members
  • 61 posts

Posted 27 August 2012 - 03:32 PM

hey all ,

I get this message when I run DBAExampleOOP.ahk

---------------------------
DBAExampleOOP.ahk
---------------------------
Error at line 2.

Line Text: #Warn, LocalSameAsGlobal, Off
Error: This line does not contain a recognized action.

The program will exit.
---------------------------
OK   
---------------------------


How can I work with mySQL manually? without the need of GUI to set up variables (without the need of DBAExampleOOP.ahk)
I tried to put :
#include mysql.ahk
but did not work with me.

thanks a lot.

#2 IsNull

IsNull
  • Fellows
  • 990 posts

Posted 28 August 2012 - 06:52 AM

Line Text: #Warn, LocalSameAsGlobal, Off
Error: This line does not contain a recognized action.

Please Install the latest Version of AHK_L. Its the first link in the Download-Section.


How can I work with mySQL manually?

You mean: How can I work without the Example-Script GUI?

Well, you have to simply include DBA:

#Include <DBA>

connectionString := "Server=localhost;Port=3306;Database=test;Uid=root;Pwd=toor;"

db := DBA.DataBaseFactory.OpenDataBase("MySQL", connectionString) [color=#408000]; MySQL[/color]

[color=#408040]; now, you can use the Database Methods like Query, QueryRow, OpenRecordSet etc...[/color]

rs := db.OpenRecordSet("Select * from Test")
while(!rs.EOF){   
	name := rs["Name"] 
	phone := rs["Phone"]  [color=#408000]; column-name oder Index[/color]
	
	MsgBox %name% %phone%
	rs.MoveNext()
}
rs.Close()