Hi sorry i got another problem now I tried to perform an Insert Into. 'Temp' variable contains values that i retrieved from notepad. However, the data that was inserted into the database is always (1, blank space). Is it because 'temp' is outside VBSTART and VBEND? if so, how do i go about correcting it? Thanks a lot for your help! below is part of the code
GetWindowText>Untitled - Notepad,temp
VBSTART
Dim ConnectionString : ConnectionString="Driver={MySQL ODBC 3.51 Driver}; SERVER=localhost; DATABASE=mydatabase; USER=root; PASSWORD=*****; OPTION=3;"
Dim MyDB
Set MyDB=CreateObject("ADODB.Connection")
MyDB.Open ConnectionString
Dim rs : rs = MyDB.Execute("INSERT INTO carriertest VALUES('1','"&temp&"')")
VBEND
Insert Statement
Moderators: Dorian (MJT support), JRL
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Have you looked at the examples and help file? You're mixing MacroScript and VBScript. So do something like this:
Please search this forum and look at the examples showing vbscript being used inside Macro Scheduler. Also look at the VBScript sample(s) that come with the software, plus the examples in the help file.
Code: Select all
VBSTART
Sub DoTheInsert(TheValue)
Dim ConnectionString
ConnectionString="Driver={MySQL ODBC 3.51 Driver}; SERVER=localhost; DATABASE=mydatabase; USER=root; PASSWORD=*****; OPTION=3;"
Dim MyDB
Set MyDB=CreateObject("ADODB.Connection")
MyDB.Open ConnectionString
Dim rs
rs = MyDB.Execute("INSERT INTO carriertest VALUES('1','"&TheValue&"')")
End Sub
VBEND
GetWindowText>Untitled - Notepad,temp
VBRun>DoTheInsert,temp
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?