Hi, i make a code fully based on this this topic:
http://p2p.wrox.com/topic.asp?TOPIC_ID=31077 It call and execute a .bat file, afther that it should run an sql query, pass the result as a variable and print it in the MsgBox myY, but it doesnt do it... what im missing?
Code:
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