Hi,
Thanks to Pete my problem is solved for now.
I wrote a simple app to change security information of a ReadOnly table in
case you have had same kind of problems. It works properly for NATIVE tables
(if directory isn't set ReadOnly), but feel free to change the code for your
own purposes.
Well, it isn't beautiful app, but it works. Maybe someone could write more
clever one using Win API...
Dim file(5), cmd As String
Dim i As SmallInt
file(1) = FileOpenDlg("","","TAB","Remove ReadOnly Flag")
If file(1) = "" Then
Exit Sub
End If
file(1) = PathToDirectory$(file(1)) + PathToTableName$(file(1)) + ".tab"
file(2) = PathToDirectory$(file(1)) + PathToTableName$(file(1)) + ".dat"
file(3) = PathToDirectory$(file(1)) + PathToTableName$(file(1)) + ".map"
file(4) = PathToDirectory$(file(1)) + PathToTableName$(file(1)) + ".id"
file(5) = PathToDirectory$(file(1)) + PathToTableName$(file(1)) + ".ind"
Open Table file(1)
If TableInfo(0,6) Then
Close Table TableInfo(0,1)
For i = 1 To UBound(file)
If FileExists(file(i)) Then
cmd = "Command.com /C attrib -r """ + file(i) + """"
Run Program cmd
End If
Next
Note "ReadOnly Flag Removed"
Else
Close Table TableInfo(0,1)
Note "Chosen Table Not ReadOnly"
End If
Thanks again,
Anssi Joutsiniemi
>Date: Tue, 26 Jan 1999 13:32:28
>To: [EMAIL PROTECTED]
>From: Anssi Joutsiniemi <[EMAIL PROTECTED]>
>Subject: ReadOnly flag
>
>Dear senior programmers,
>
>I have a minor problem that has puzzled me for some time.
>I am working on with a MapBasic program to change projection settings of a
set of files. So far so good, but some exiting files have been set to
ReadOnly, so the application cannot replace the existing ones. I have tried
to Commit, Drop and Kill..(It isn't possible to get the MetaData key visible
either); even the Api function DeleteFile() will result #5, "Access is
Denied" error.
>So my brief question: Is it possible to change Security settings of a file
to get rid of ReadOnly flag or get the ReadOnly file killed other way.
>
>Thanks,
> Anssi Joutsiniemi
>
----------------------------------------------------------------------
To unsubscribe from this list, send e-mail to [EMAIL PROTECTED] and put
"unsubscribe MAPINFO-L" in the message body, or contact [EMAIL PROTECTED]