MS Access LDB file (lock) and INSERT Failure

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Hi,

I am writing a subscription page in C#. I first check if username is unique by

"SELECT UserName FROM Logins WHERE Username ='dadada'"

Then if unique, I create the user by

"INSERT INTO Logins
(UserName,UserType,Password,StartDate,Status,Email,Phone,Home) VALUES
('dadada','u','dadadada',#8/25/2005 5:22:33
PM#,'trial','d@xxxxxxxxx','1231231231','10 brechk st., bridgewater, nj
08807')"

Somehow this always returns exception after running dbCmd.ExecuteNonQuery()
as below

"Syntax error in INSERT INTO statement."

I checked the syntax many times, could not find anything wrong.

When user logins in, I update the DB successfully as below:

"INSERT INTO Visits (Email,LoginDate,ReferPage,LoginOK,LoginPass,IP) VALUES
('admina',#8/25/2005 5:25:16
PM#,'/passwordProtectCSharp/privatePage.aspx',1,'adminabc','127.0.0.1')"

So access to DB is OK. I suspect my first reading to Logins table caused ldb
lock. So I can not insert afterwards. After removing the check of uniqueness,
I still have the same error.

Any suggestions? Thanks. -Dale
PS. ldb file sometimes stays there for a long time, sometimes it disappears
soon after code is stopped. can not delete it. any way to control it?

.



Relevant Pages

  • Re: how to specify domain SLASH user in Query Analyzer when creating users and granting permissions
    ... Logins can have the slash, ... > I'm working in Query Analyzer because the Enterprise Manager ... > give the domain\ chunk of the username. ...
    (microsoft.public.sqlserver.security)
  • Re: Scheduled tasks "Could not start"
    ... login in with the Administrator username and pw from terminal services). ... the other scheduled tasks under other logins continued to run without ...
    (microsoft.public.windows.server.security)
  • Re: Scheduled tasks "Could not start"
    ... protected storage and that changing it fixed the problem. ... that account obviously was not changed in the local sam since you could ... login in with the Administrator username and pw from terminal services). ... the other scheduled tasks under other logins continued to run without ...
    (microsoft.public.windows.server.security)
  • Re: Sample C# code with user logins/passwords?
    ... logins into the website: this will vary widely depending on what you want to ... database to store username and password information or are you going to use ... xml files....You get the idea. ...
    (microsoft.public.dotnet.languages.csharp)