A
Aldo
in the past days, John show me how to run a shell command from VB, now what
im triying to accomplish this:
- Run a shell script
- Run a SQL query, store the result in a variable called "k"
- Print the "k" variable content in a MessageBOX
This is basically the proccess: The shell create a new table record, and the
sql is for get the new record ID, and the MessageBOX will be used for display
the record ID just created
This is the code but i dont kwnow where it breaks...
Private Sub CmdRMSfile_Click()
Dim strCmd As String
Dim ds As Database
Dim dds As Recordset
Dim myY
Dim k As DAO.QueryDef
strCmd = """C:\xml2odbc\po.bat"""
Shell strCmd
Set ds = OpenDatabase("C:\OM-TEST\StoneEdge\SEOrdMan2002.mdb")
k = "select MAX(OrderNumber) from [Orders];"
Set dds = ds.OpenRecordset(k)
myY = dds!kk
MsgBox myY
ds.Close
End Sub
Thanks in advance.
im triying to accomplish this:
- Run a shell script
- Run a SQL query, store the result in a variable called "k"
- Print the "k" variable content in a MessageBOX
This is basically the proccess: The shell create a new table record, and the
sql is for get the new record ID, and the MessageBOX will be used for display
the record ID just created
This is the code but i dont kwnow where it breaks...
Private Sub CmdRMSfile_Click()
Dim strCmd As String
Dim ds As Database
Dim dds As Recordset
Dim myY
Dim k As DAO.QueryDef
strCmd = """C:\xml2odbc\po.bat"""
Shell strCmd
Set ds = OpenDatabase("C:\OM-TEST\StoneEdge\SEOrdMan2002.mdb")
k = "select MAX(OrderNumber) from [Orders];"
Set dds = ds.OpenRecordset(k)
myY = dds!kk
MsgBox myY
ds.Close
End Sub
Thanks in advance.