Question please

  • Thread starter Thread starter mmadani
  • Start date Start date
M

mmadani

I need to clear records in a table in another DATABASE using a sql delete
command . The target Database is secured. I am the owner of the database . I
have the security file (.MDW) and the admin password.

I am looking for a syntax on how to do that., where I would be able to enter
the location of the system file, and user ID ,and password, as I don't want
just anyone to delete that data. Any help would be greatly appreciated.

M. Madani
 
You can build an ADO connection that will allow you to execute action
queries:

Dim con As ADODB.Connection
Dim strUser as String
Dim strPass As String
dim strSystem as String

struser = Inputbox("Enter Your Username","User")
strpass = Inputbox("Enter Pass", "Pass")
strSystem = Inputbox("Path To System","System")

Set con = New ADODB.Connection

con.ConnectString= "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=c:\somepath\mydb.mdb;" & _
"Jet OLEDB:System Database=" & strSystem , _
struers, strpass

con.Execute "DELETE * FROM NameOfYourTable"

con.Close
Set con = Nothing
 
Thanks Scott!


Scott McDaniel said:
You can build an ADO connection that will allow you to execute action
queries:

Dim con As ADODB.Connection
Dim strUser as String
Dim strPass As String
dim strSystem as String

struser = Inputbox("Enter Your Username","User")
strpass = Inputbox("Enter Pass", "Pass")
strSystem = Inputbox("Path To System","System")

Set con = New ADODB.Connection

con.ConnectString= "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=c:\somepath\mydb.mdb;" & _
"Jet OLEDB:System Database=" & strSystem , _
struers, strpass

con.Execute "DELETE * FROM NameOfYourTable"

con.Close
Set con = Nothing

--
Scott McDaniel
CS Computer Software
www.thedatabaseplace.net

..
 
Back
Top