![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | first time doing vbscript need help pls I have a Windows Script Host (xp pro service pack 3) that delete a file access 2000 without password but I get the message : Impossible read record. Autorization of read not avaiable for "MyTable"(this is my traduction) Code: 80040E09 I put "Everyone" group with full control policy but is just the same! Dim rst Dim strSQL Dim gdbConn strSQL = vbNullString strSQL = strSQL & "Delete from MyTable" ' etc... Call GetDataConnection() Set rst = gdbConn.Execute (strSQL) Set rst = Nothing Call CloseDataConnection() '=========================== Function GetDataConnection() '=========================== Dim strConn Set gdbConn = Nothing Set gdbConn = CreateObject("ADODB.Connection") gdbConn.Provider="Microsoft.Jet.OLEDB.4.0" strConn = "C:\Cancella\MyMDB.mdb" On Error Resume Next gdbConn.Open strConn If err.number <> 0 Then Msgbox err.description, vbExclamation+vbOkOnly, "Database Connection Error" End If Set GetDataConnection = gdbConn blnConnect = True End Function '======================== Sub CloseDataConnection() '======================== If Not(gdbConn Is Nothing) Then gdbConn.Close Set gdbConn = Nothing End If End Sub |
My System Specs![]() |
| | #2 (permalink) |
| | Re: first time doing vbscript need help pls "franco monte" <montefm@xxxxxx> wrote in message news:2dfff34e-8b4d-4d48-b09b-979e2c56ae0e@xxxxxx Quote: >I have a Windows Script Host (xp pro service pack 3) that delete a > file access 2000 without password but I get the message : > Impossible read record. Autorization of read not avaiable for > "MyTable"(this is my traduction) > Code: 80040E09 > I put "Everyone" group with full control policy but is just the same! > > > Dim rst > Dim strSQL > Dim gdbConn > strSQL = vbNullString > strSQL = strSQL & "Delete from MyTable" ' etc... > Call GetDataConnection() > Set rst = gdbConn.Execute (strSQL) > Set rst = Nothing > Call CloseDataConnection() > > '=========================== > Function GetDataConnection() > '=========================== > Dim strConn > > Set gdbConn = Nothing > Set gdbConn = CreateObject("ADODB.Connection") > gdbConn.Provider="Microsoft.Jet.OLEDB.4.0" > strConn = "C:\Cancella\MyMDB.mdb" > On Error Resume Next > gdbConn.Open strConn > If err.number <> 0 Then > Msgbox err.description, vbExclamation+vbOkOnly, "Database Connection > Error" > End If > > Set GetDataConnection = gdbConn > blnConnect = True > End Function > > '======================== > Sub CloseDataConnection() > '======================== > If Not(gdbConn Is Nothing) Then > gdbConn.Close > Set gdbConn = Nothing > End If > End Sub specify "Data Source=" in the connection string. I don't know if this will help in your case. For example: ========== ' Connection string for MS Access database. strConnect = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" _ & "C:\Cancella\MyMDB.mdb" ' Connect to MS Access database. Set adoCommand = CreateObject("ADODB.Command") adoCommand.ActiveConnection = strConnect ' Modify table MyTable. adoCommand.CommandText = "DELETE FROM MyTable WHERE ..." adoCommand.Execute ========= Otherwise, you may lack permissions. You error message seems to indicate this. Can you open the database in MS Access by double-clicking on the *.mdb file? If so, can you modify the table? -- Richard Mueller MVP Directory Services Hilltop Lab - http://www.rlmueller.net -- |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| How to do No hang up VBScript (nohup for VBScript) | VB Script | |||
| Windows System Time and Desktop time not matching up | Vista General | |||
| Changing the time zone changes the appointment time in calendar | .NET General | |||
| Internet Time Synchronization Incorrect - Showing Standard Time | PowerShell | |||
| Demo of getting/setting time from an RFC867 time source | PowerShell | |||