No, it's common name for all table in this database
QuynhTD
No, it's common name for all table in this database
QuynhTD
The connection string is: "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\DB.MDB" DB.MDB is an access 97 file. I opened with VS2008. It connect successfully with user ID "Admin" and any password. I can receiver all the tables but can get any record data, it throw message : --------------------------- Microsoft Visual Studio --------------------------- SQL Execution Error. Executed SQL statement: SELECT * FROM TABLE_NAME Error Source: Microsoft JET Database Engine Error Message: Record(s) cannot be read; no read permission on 'TABLE_NAME'. --------------------------- OK Help ---------------------------
QuynhTD
Thanks, but I can't find out how to "change the security in the Access database" or use a different account. Access's menu : Tools>Security> User and Group Permission always disable :(
QuynhTD
I connected with an Access 2.0 file with Server Explorer in VS2008. It can list all table in this database but when I get all row's data of one table It throw the Exception : "Record(s) cannot be read; no read permission on 'table's name'" How can I fix this? Thanks for any help!
QuynhTD
OK, your ideals are very helpful. Thank u very much! Rdgs,
QuynhTD
In fact I want to get,set all permission (Read, write, ..in FileSystemRights) in Folder's ACL of one user on WinNT. I solved it but I have to get WindowsIdentity object of user . Here is the code:
public void SetFolderPermission(string userName, string fullPath, AccessControlType accessControlType,
FileSystemRights fileAccessPermisson)
{
var dInfo = new DirectoryInfo(fullPath);
DirectorySecurity dSecurity = dInfo.GetAccessControl();
dSecurity.AddAccessRule(new FileSystemAccessRule(userName, fileAccessPermisson,
InheritanceFlags.ContainerInherit |
InheritanceFlags.ObjectInherit, PropagationFlags.None,
accessControlType));
dInfo.SetAccessControl(dSecurity);
}
public void RemoveAllFolderPermission(string userName, string fullPath, string password, string domain)
{
WindowsIdentity \_principal = getWindowsIdentity(userName, domain, password);
if (\_principal == null)
{
throw new Exception("Invalid domain\\\\username or password");
return;
}
var dInfo = new DirectoryInfo(fullPath);
DirectorySecurity dSecurity = dInfo.GetAccessControl();
AuthorizationRuleCollection acl = dSecurity.GetAccessRules
(true, true, typeof (SecurityIdentifier));
int count = acl.Count;
int i = 0;
while (i < count)
{
var rule =
(FileSystemAccessRule) acl\[i\];
if (\_principal.User.Equals(rule.IdentityReference))
{
dSecurity.RemoveAccessRule(rule);
}
i++;
}
dInfo.SetAccessControl(dSecurity);
}
\[DllImport("advapi32.dll", CallingConvention = CallingConvention.StdCall)\]
public static extern bool LogonUser(string lpszUsername,
string lpszDomain, string lpszPassword, int dwLogonType,
int dwLogonProvider, ref IntPtr phToken);
private static WindowsIdentity getWindowsIdentity(string userName, string Domain, string Password)
{
No, I don't want those information. I want to get WindowsIdentity object from username. I want to have a function that : WindowsIdentity identity = GetWindowsIdentityFromUserName(string userName) ???
QuynhTD
I can get WindowsIdentity with this Function: [DllImport("advapi32.dll", CallingConvention = CallingConvention.StdCall)] public static extern bool LogonUser(string lpszUsername, string lpszDomain, string lpszPassword, int dwLogonType, int dwLogonProvider, ref IntPtr phToken); private static WindowsIdentity getWindowsIdentity(string userName, string Domain, string Password) { bool posix = ((int) Environment.OSVersion.Platform == 128); WindowsIdentity user = null; try { if (posix) { user = new WindowsIdentity(userName); } else { IntPtr token = IntPtr.Zero; LogonUser(userName, Domain, Password, 2, 0, ref token); if (token == IntPtr.Zero) { return null; } user = new WindowsIdentity(token); } } catch (Exception ex) { return null; } return user; } But I want to get WindowIdentity with only Domain\UserName argument? Thanks for any idea !
QuynhTD
My string is serial of words( abc**& # SomeInterger;** ) How can I convert it to utf8 as ( abc**?** ) Thanks!
QuynhTD
modified on Tuesday, December 18, 2007 1:44:31 PM
I user Asp.Net 2.0 and VS 2005 in my website. In video page I use tag to show video file (*.Dat, mp3, avi..): ]]>' />
I want to connect to sql server on other VLAN (C# 2005 ). Exam: Client IP : 192.168.10.100 SQL server IP : 192.168.20.200 Is it possible???
QuynhTD
I made it only "Script" and it run well. Thank you very much. I will try ASP.NET handler later.
QuynhTD
Yes, my virtual folder has permissions for 'Scripts and Executables' but it still don't work? :confused:
QuynhTD
In my web application ( ASP.NET vs2005, Framework 2.0, IIS 5.1), when I set Hyperlink's NavigateUrl to a exe file ( exam : http://localhost/MyApp/Upload/file1.exe ) it don't work ( Others file type's OK) I've already add MIME {.exe, application/octet-stream } in HTTP Header but it still don't work. It thraw : CGI Timeout The specified CGI application exceeded the allowed time for processing. The server has deleted the process. Can u help me? Thanks!
QuynhTD
I need to present data with rows and columns unusually. Can u suggest me any solution?
QuynhTD
when i use axMSFlexGrid 6.0 in Net it can't display correct unicode font. Can you help me? thanks.
QuynhTD
I want to have a diagonal Line object as a usercontrol. It can automatic process events as click, drag and drop...Can you help me? Thank a lot.
QuynhTD
SELECT o.ID, s.IDUser, s.Year FROM MyTable AS o INNER JOIN (SELECT IDUser, MAX(Year) FROM MyTable GROUP BY IDUser) AS s ON o.IDUser = s.IDUser AND o.Year = s.Year It is OK. Thanks you very much !
Error s: SELECT IDUser, MAX(Year) FROM MyTable GROUP BY Year Exception : "Column IDUser is invalid in the select list because it is not contained in erther an aggregate function or the Group by clause"???
I have a table : ID ___ IDUser ___ Year 1 ___ 1 ___ 2005 2___ 1 ___ 2007 3 ___ 1___ 2003 4___ 2___ 2008 5 ___ 2___ 2005 I want to filt : unique IDUser with Max year : ID ___ IDUser ___ Year 2___ 1 ___ 2007 4 ___ 2 ___ 2008 Please help me. Thanks.