T
Tam
Hi Friends,
I want to be able to delete the data in the database once the
user loads the form on the network from the tables to which he submits the
data To.
I have the following code as the script which does the job :
Sub XDocument_OnLoad(eventObj)
DeleteContentsFromDataBase "Test_Plan"
DeleteContentsFromDataBase "Test_Group"
End Sub
Public Function DeleteContentsFromDataBase(TableName)
MySQL = "DELETE * FROM "& TableName
Const adOpenStatic = 3
Const adLockOptimistic = 3
Set objRecordSet = Nothing
MyDatabaseFilePathAndName = "\\Two\Automation\Databases\TestInput.mdb"
Set objConnection = CreateObject("ADODB.Connection")
Set MyDatabase = CreateObject("ADODB.Recordset")
MyConnection = "Provider=Microsoft.Jet.OLEDB.4.0;"
MyConnection = Myconnection & "Data Source=" & MyDatabaseFilePathAndName & ";"
MyDatabase.Open MySQL,Myconnection,adOpenStatic,adLockOptimistic
End Function
I am able to achieve the functionality on my local system but when users
open the form on a network it doesnt delete the data from tables. Users are
able to submit the data over the nework once I manually clean up the data.
When I execute the same script function DeleteContentsFromDatabase over the
network by other means (script debuggers) the function works so there is no
question of security etc.,
What could be wrong in this case ???
I want to be able to delete the data in the database once the
user loads the form on the network from the tables to which he submits the
data To.
I have the following code as the script which does the job :
Sub XDocument_OnLoad(eventObj)
DeleteContentsFromDataBase "Test_Plan"
DeleteContentsFromDataBase "Test_Group"
End Sub
Public Function DeleteContentsFromDataBase(TableName)
MySQL = "DELETE * FROM "& TableName
Const adOpenStatic = 3
Const adLockOptimistic = 3
Set objRecordSet = Nothing
MyDatabaseFilePathAndName = "\\Two\Automation\Databases\TestInput.mdb"
Set objConnection = CreateObject("ADODB.Connection")
Set MyDatabase = CreateObject("ADODB.Recordset")
MyConnection = "Provider=Microsoft.Jet.OLEDB.4.0;"
MyConnection = Myconnection & "Data Source=" & MyDatabaseFilePathAndName & ";"
MyDatabase.Open MySQL,Myconnection,adOpenStatic,adLockOptimistic
End Function
I am able to achieve the functionality on my local system but when users
open the form on a network it doesnt delete the data from tables. Users are
able to submit the data over the nework once I manually clean up the data.
When I execute the same script function DeleteContentsFromDatabase over the
network by other means (script debuggers) the function works so there is no
question of security etc.,
What could be wrong in this case ???