V
Vic Spainhower
Hello,
I have an Access program that needs to upload some data to MySQL database on
a web site. I want it to be as transparent to the user as possible and I
only want the user to have to just press a button and it all happents
without further input from them. It needs to be sent in 2 different batches
because the first part will load a table and an id is assigned which needs
to come back to the Access program and update a table and then generate the
next pieces which will have the id assigned from the first part.
The fist part is working and the MySQL table is loaded and the id is
assigned using some PHP code. How can I get this number back to the Access
program? Following is the Access code and it is using FSO but it doesn't
look like I can use an HTTP address as it complains there is a bad file name
or number.
Would someone be so kind as to offer a solution! I would certaily
appreciate any input anyone would care to provide.
Thanks,
Vic
..........................
Public Sub ExportShowDetails(creatorAddress as String, showName as String)
Dim resp As Long
Dim url As String
Dim creatorAddress As String
Dim ShowName As String
Dim lShowID As Long
Dim fs As New FileSystemObject
Dim ts As TextStream
DoCmd.TransferText acExportDelim, "qryEventDetails Specs",
"qryEventDetails", _
CurrentProject.Path & "\newshow.csv", False
url = "http://localhost/mysite/uploads/upload.php?arguments=newshow.csv;" &
creatorAddress & ";" & ShowName
Call ShellExecute(0&, vbNullString, url, vbNullString, vbNullString,
vbNormalFocus)
' Now we must wait untill we can get the ShowID that would have been
assigned in part 1
' After the show has been loaded, it will put a file in the uploads folder
which contains the showID
url = "http://localhost/mysite/uploads/showid.txt"
Set ts = fs.OpenTextFile(url, ForReading) <===== **
Error occurs here **
lShowID = ts.ReadLine
' ** Now send the remaining table data to the server **
End Sub
I have an Access program that needs to upload some data to MySQL database on
a web site. I want it to be as transparent to the user as possible and I
only want the user to have to just press a button and it all happents
without further input from them. It needs to be sent in 2 different batches
because the first part will load a table and an id is assigned which needs
to come back to the Access program and update a table and then generate the
next pieces which will have the id assigned from the first part.
The fist part is working and the MySQL table is loaded and the id is
assigned using some PHP code. How can I get this number back to the Access
program? Following is the Access code and it is using FSO but it doesn't
look like I can use an HTTP address as it complains there is a bad file name
or number.
Would someone be so kind as to offer a solution! I would certaily
appreciate any input anyone would care to provide.
Thanks,
Vic
..........................
Public Sub ExportShowDetails(creatorAddress as String, showName as String)
Dim resp As Long
Dim url As String
Dim creatorAddress As String
Dim ShowName As String
Dim lShowID As Long
Dim fs As New FileSystemObject
Dim ts As TextStream
DoCmd.TransferText acExportDelim, "qryEventDetails Specs",
"qryEventDetails", _
CurrentProject.Path & "\newshow.csv", False
url = "http://localhost/mysite/uploads/upload.php?arguments=newshow.csv;" &
creatorAddress & ";" & ShowName
Call ShellExecute(0&, vbNullString, url, vbNullString, vbNullString,
vbNormalFocus)
' Now we must wait untill we can get the ShowID that would have been
assigned in part 1
' After the show has been loaded, it will put a file in the uploads folder
which contains the showID
url = "http://localhost/mysite/uploads/showid.txt"
Set ts = fs.OpenTextFile(url, ForReading) <===== **
Error occurs here **
lShowID = ts.ReadLine
' ** Now send the remaining table data to the server **
End Sub