problems writing to database in 7.2
Moderators: JRL, Dorian (MJT support)
problems writing to database in 7.2
I am using VB to import data into an access 2000 database. When I recompiled the script with MS 7.2, my script no longer wrote to the database, but did not post any errors. I would love to take advantage of the new functions in 7.2, but cannot if I continue to have this problem. Does anyone know what might cause this? Is there a different command syntax in 7.2 that I am unaware of? Thanks for the help.
- Bob Hansen
- Automation Wizard
- Posts: 2475
- Joined: Tue Sep 24, 2002 3:47 am
- Location: Salem, New Hampshire, US
- Contact:
Here is a sample:
VBSTART
Function export(sqlstr,field)
set cn = CreateObject("ADODB.Connection")
cn.open "Driver={Microsoft Access Driver
(*.mdb)};DBQ=\\server\database.mdb"
Set rs = cn.Execute("" & sqlstr & "")
export = rs.Fields("" & field & "")
cn.close
End Function
function import(sqlstr)
set cn = CreateObject("ADODB.Connection")
cn.open "Driver={Microsoft Access Driver
(*.mdb)};DBQ=\\server\database.mdb"
set rs = cn.Execute("" & sqlstr & "")
cn.Close
End function
VBEND
Input>a,Enter style:,Style
Input>b,Enter Service Tag:,XXXXXX
let>sqlstr=Insert into installs (style, asset) values ('%a%', '%b%')
VBeval>import("%sqlstr%")
let>sqlstr2=SELECT * FROM installs where asset = '%b%'
let>field=style
VBEval>export("%sqlstr2%","%field%"),output
MessageModal>The output Is : %output%
VBSTART
Function export(sqlstr,field)
set cn = CreateObject("ADODB.Connection")
cn.open "Driver={Microsoft Access Driver
(*.mdb)};DBQ=\\server\database.mdb"
Set rs = cn.Execute("" & sqlstr & "")
export = rs.Fields("" & field & "")
cn.close
End Function
function import(sqlstr)
set cn = CreateObject("ADODB.Connection")
cn.open "Driver={Microsoft Access Driver
(*.mdb)};DBQ=\\server\database.mdb"
set rs = cn.Execute("" & sqlstr & "")
cn.Close
End function
VBEND
Input>a,Enter style:,Style
Input>b,Enter Service Tag:,XXXXXX
let>sqlstr=Insert into installs (style, asset) values ('%a%', '%b%')
VBeval>import("%sqlstr%")
let>sqlstr2=SELECT * FROM installs where asset = '%b%'
let>field=style
VBEval>export("%sqlstr2%","%field%"),output
MessageModal>The output Is : %output%