Vb.net 2005, Sql2005 Not Locking The Records While Editing
Dec 18, 2007
I have created a database and used visual basic 2005.net2.0 to build the application. I used the data wizard. it created datatables and then I bound it to the contols on the form. The program is published to the server and each instance loads from the server and executes. When it stops, the instance is destructed from the host pc. The pc's are large ram and very small hard drive. These were the specs of the job. now when each pc loads an instance of the program, they can all load and edit the same exact record. I tried to bust it and I got on the same record and changed first name on one and last name on the other. the second one overwrote the first name edit. All of the data handling is done inside of the dataset designer and it does not allow edits. ( actually you can edit, but the next time you save it, or run it, it will rewrite what you added and it will be gone.) is there anything I can add to the form vb to tell it to lock the current record?
View 3 Replies
ADVERTISEMENT
Jul 20, 2005
I have an SP which I use to insert into a table data from another. Forexample...INSERT INTO myWorkTable(Field1, Field2)SELECTmyField1, myField2FROMmyNewTableIt's a pretty straight forward sp. Now, the data that gets insertedseems to have remained in a state that stops me updating it later. TheSP is called by one app which is then closed and not used again untilthe following month. The sp shouldn't be used by anything else.I have another application which goes to the table (in my examplemyWorkTable) and is supposed to open and edit specific records whichit does correctly navigate to (a few days after the sp). It fails andI get an error message stating that the record is being edited byanother user. This record should not be opened by any other process.If I export the data and re-import it into the table, it worksperfectly fine.The code used to edit the table is fine and has worked for a couple ofyears and I'm happy with it. The only change I have made is to use anSP to import the data instead of an old method using Access 2000. Thefunctionality is the same, even though the connection is different.The Delphi app uses BDE.Inserting directly through SQL works as I would have expected and Ican edit the record as I need.I'm guessing that Delphi (which I use for the app) is somehow notfreeing up the data locked by the SP when it finished calling the SP,even when it is closed. However, it seems a little bizarre as I wouldexpect it to free up the data affected by the SP once it has finished(maybe this is the wrong assumption).So, my question is, can an SP lock records in this way ? If so,how/why and can I stop this once finished, or is there a way ofchecking / resetting records which were locked up and should no longerbe this way. I can't see anything obvious which shows the records arelocked, but am willing to delve further.ThanksRyan
View 2 Replies
View Related
Jan 24, 2008
Hello, i currently have a gridview that is populated with data from a SQLServer datasource. I have put an output mask in the select statement, so the date and time attributes are displayed in the format i prefer them to be in. SELECT PatientNo, ConsultantName, HospitalName, CONVERT (varchar, Date, 101), CONVERT (varchar, Time, 8) FROM [Appointment];
However when i click the 'edit' link for a record in the gridview, i am unable to edit the date/time attributes and when i click update to confirm any changes to the other attributes, the values in the date/time attributes are emptied. How can i solve this update problem. I'm guessing i need to configure my SQL UPDATE statement, but bit stuck how i do this. Please help!
Thanks,
James
View 9 Replies
View Related
Jul 20, 2005
Hi,I have an Access application with linked tables via ODBC to MSSQLserver 2000.Having a weird problem, probably something i've done while not beingaware of (kinda newbie).the last 20 records (and growing)of a specific table are locked - cantchange them - ("another user is editing these records ... ").I know for a fact that no one is editing records and yet no user canedit these last records in the MDB - including the administrator -while able to add new records.Administrator able to edit records in the ADP (mssql server) where thetables are stored.Please help, the application is renedred inert .Thanks for reading,Oren.
View 3 Replies
View Related
Feb 1, 2000
Hi
I've got table JOBS with JOB_ID, ORIGINATOR_ID etc. I prepare stored procedure that creates job, that mean,
inserts new record in table JOBS, and return JOB_ID as a result.
return (select MAX (JOB_ID) from JOBS where ORIGINATOR__ID = PARTICULAR_USER_ID)
The problem is when user is logged in two stations, runs two application and create job at the same time.
It is possible that both application receive the same MAX (JOB_ID)
Any suggestions how to lock records, or do it in a different way.
Michal
View 2 Replies
View Related
Oct 18, 2006
Hello,
Can anyone help find a solution to a strange record locking problem in SQL 2000?
This stored procedure is run every two seconds by two workstations to auto-process specialized "jobs". This convoluted code began as a simple update statement, but as grown to this in an effort to prevent the two workstations from picking up the same record at the same time. Unfortunately, the machines are STILL managing to pickup the same job, which seems to be indicating some form of record locking issue.
We've tried a number of locking hints, single BEGIN/COMMIT transaction command sets, and now a granular pair of transactions complete with additional filtering in the update command's where clause, but the two client machines continue to get the same job row.
Any thoughts on how to ensure that once once machine "grabs" a job, the other will not somehow get the same record ??
Here's the current state of the procedure code:
create Procedure dbo.spGetWFAutoJob216
@strActionSelected as varchar(150)
--stractionselected have all the selected actionid, seperated by comma.
as
Declare @JobID as varchar(10)
Declare @FoundJobID as varchar(10)
Set @JobID = -100
Set @FoundJobID = -100
begin tran
Select top 1 @FoundJobID = JobID from WFJob J
Join WFAutoJobDetail AJD on (AJD.WFActionID = J.ActionID and CharIndex(cast(ajd.wfactionid AS VARCHAR), @strActionSelected) > 0)
where isnull(J.Status, 'P') = 'P'
Order By J.Priority Asc, J.enteredDate ASC
commit tran
Begin Tran
Update WFJob
Set Status = 'I',
@JobID = jobID
where isnull(Status, 'P') <> 'I' and JobID = @FoundJobID
insert into wfjoblogger values (host_name(), getdate(), @FoundJobID, @JobID)
Commit Tran
Select Coalesce(A.Name, 'No Action Record') as ActionName, *
from WFJob J
Join WFAutoJobDetail AJD on AJD.WFActionID = J.ActionID
Left Join WFAction A On A.ID = J.ActionID
Where JobID = @JobID and isnull(J.Status, 'P') = 'I'
go
And here's an example of the log table results showing a few instances of the two machines getting the same jobid records:
LogID
Host
datetime
foundjob
thejob
51
SVR2
52:05.110
1049419
1049419
52
SVR2
52:12.140
1042784
1042784
53
SVR2
52:20.843
1052719
1052719
54
SVR2
53:12.920
1043496
1043496
55
SVR2
53:23.250
1045710
1045710
56
SVR2
53:30.297
1055096
1055096
57
SVR2
54:21.000
1043511
1043511
58
SVR2
55:06.907
1055095
1055095
59
SVR2
56:08.237
1055092
1055092
60
IS-1004
56:11.407
1055092
1055092
61
SVR2
56:43.313
1045366
1045366
62
SVR2
56:52.703
1052723
1052723
63
IS-1004
57:00.190
1052723
1052723
64
IS-1004
57:23.300
1055085
1055085
65
SVR2
57:25.970
1055085
1055085
66
IS-1004
58:24.877
1052286
1052286
67
IS-1004
58:44.877
1043491
1043491
68
IS-1004
59:08.270
1052727
1052727
69
SVR2
59:13.207
1052727
1052727
View 2 Replies
View Related
Feb 28, 2006
Hi,
How can i handle record locking in sql server?
View 1 Replies
View Related
Jan 5, 2004
In the application I'm working on, I need to be able to use different locks on my records during certain transactions. I need to know how to do this programmatically from within VB.net. If someone can show me an example of how to do this or show me where I could find some, I'd appreciate that.
Thanks.
View 2 Replies
View Related
Jul 7, 2006
Hi guys
Am i able to deny the SA account access to a specific database?
thanks in advance for your help.
TheGing
View 4 Replies
View Related
Apr 28, 2006
I am using a XML file and retrieving data for my SSIS 2005 (Intigration Service) package, where after retrieving the data I need to update my XML file with new data by using script task or XML task
<?xml version="1.0" ?>
<TimeBuilder>
<StartYear>2003</StartYear>
<EndYear>2004</EndYear>
</TimeBuilder>
View 3 Replies
View Related
Jun 21, 2006
Previously in Sql Server 2000, we would be in enterprise manager, you'ddouble click on a view, and a nice little dialog box opened with the t-sqlstatetments, there was also a check sql syntax and apply and cancel buttons.Not exactly query anaylizer, just a quick lightweight dialog box. Is thisfeature still around? Seems like I have to go into the query anaylizer likemode to edit a view now. I am a total newbie to version 2005. Are there anyoptions I can set to make it behave the old way? All feedback isappreciated.TIA,~CK
View 2 Replies
View Related
Apr 25, 2007
I have a sql server 2005 database with Delphi 2006 in the front end and for querrying and reporting we use MS Access 2003 by connecting to this database via ODBC connection. I recently found out that the SQL Server 2005 data connected thus can be edited (updated) from MS Access. I do not want end users to modify/update the SQL Server 2005 data from MS Access while I also want them to have the ability to insert/update/delete rights using the appropriate application interface. For now, I am handling this by creating a user id that is not permitted to update, insert and delete and using the same account in the ODBC. Is there a way in SQL Server 2005 you can control insert/update/delete rights for all users that will be applicable only in the ODBC mode?
Any help will be greatly appreciated.
thulo
View 3 Replies
View Related
Jun 7, 2006
We have found that it is common for Visual Studio 2005 to crash when editing or running SSIS packages -- from CTP versions through beta versions and including the release version.
Of course we kept hoping that newer releases would become more stable, or at least more robust -- and now I'm hoping there will be a service pack, which might make it more robust?
View 3 Replies
View Related
May 2, 2006
Please help me with editing a XML file through script tack in SSIS (Integration Service) 2005
Thank you
View 1 Replies
View Related
Jan 29, 2008
Hi pardon my ignorance but I wonder if someone could answer a few questions for me.
I am writing a program which will be used by perhaps upto 100 users at a time. The program sits on any number of PCs and loads user specific data to a given PC according to who has logged on to windows on that PC.
A number of data items loaded from the user table have to be unique as they are usernames for other systems that my program simplifies access to.
So when a user logs on to my program for the first time a row is created for them in the user table (indexed by a GUID and their unique network name). The other unique fields are left blank and the user is given an opportunity to fill these details in.
Before writing these details to the user's row in the 'users table' the program loads the whole user table down and checks that these items are unique before committing them to that user's row in the table.
The problem of course is that if between the program downloading the user table into a local datatable, checking the values are unique and then actually writing them someone else writes the same data into their row then 2 users end up with the same data - which shouldn't be allowed. i.e. 2 users can't have the same user name for the other software.
How can I solve this problem with locking? Once the user table is downloaded and in a locel datatable presumably the table is no longer locked so another user could write data to the table.
I acutally think this is going to be a pretty rare occourance but I still want to try to cover all eventualities.
I suspect the problem is the way my program is going about the checking.
Should I use an SQL insert statement like??
If exists(SELECT username from users where username=@username)
BEGIN
RAISEERROR("Username already exists")
END
ELSE
BEGIN
INSERT etc
If so I guess this will simplify my code. Is this the correct thing to do? And then just trap the errors that arise if a duplicate does arise?
Also some more general questions.
1)I presume 2 users simultaneously looking up data from 2 different rows in a table doesn't lock the table so one search fails? I use the code below having set up a command to run a stored procedure to search for a user by their network name.
Dim lclRowRet As SqlDataReader
lclRowRet = LoadUserCommand.ExecuteReader(CommandBehavior.SingleRow)
lclRowRet.Read()
2) I presume writing data to my user table a row at a time will also not cause a lock. I create a command object with all the row values in and then do a command.executenonquery()
As a rule I close all my connections as soon as I'm done with them.
Many thanks for your help in advance.
nik
View 5 Replies
View Related
Apr 24, 2008
Good afternoon everyone,
I hope that I am not asking a question which has been answered many times in the past, I did a search but could not find an answer. These may be beginner questions, so bear with me as I am something of a beginner.
This week our organization updated from SQL 2000 to SQL 2005. We are using a Microsoft Access front end for this data and the information is entered through forms into the correct tables. When our researchers are enter the information they also have to sometimes search existing information to ensure they do not duplicate what is already in there. For this we use several access queries. This has worked well on the SQL 2000 server without any issues. However, now that we are on 2005 we are starting to recieve ODBC Call fail errors and errors which specify that they are a result of a deadlock. My first question is, are the ODBC call fail errors possibly locks which caused the ODBC connection to time out? My second question is why am I recieving these errors in 2005 but not 2000?
Thanks in advance for any help
- Hitz
View 1 Replies
View Related
Dec 15, 2005
hi
i try to restore a bak file from another sql2005 server to my sql2005 server, but it show the error message as below :
TITLE: Microsoft SQL Server Management Studio Express
------------------------------
An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.Express.ConnectionInfo)
------------------------------
ADDITIONAL INFORMATION:
Cannot open backup device 'C:Program FilesMicrosoft SQL ServerMSSQL.1MSSQLBackupackup.bak'. Operating system error 5(error not found).
RESTORE HEADERONLY is terminating abnormally. (Microsoft SQL Server, Error: 3201)
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=09.00.1399&EvtSrc=MSSQLServer&EvtID=3201&LinkId=20476
------------------------------
BUTTONS:
OK
------------------------------
pls some one can help me ???
thanks
chaus
View 62 Replies
View Related
Oct 12, 2007
Can you open/use a database created in SQL2005 in SQL2005 Express?
Thanks for the help!
Max
View 4 Replies
View Related
Jul 13, 2007
Hi,
web searches give no end of how extended stored procedures can only be written in C++ ( or maybe vb also) .
And that extended stored procedures should be abandonded in favour of CLR framework procedures.
And how most articles explain how to convert ESPs to CLR procedures!!!!!
But I need to pass a non-discript block of binary data, extract pieces of data identified by its offset into the block, data type inferred by offset; into data to be written to the SQL database. These offsets are determinede by mapping (C UNION) to C typedef structures.
This cannot be done by managed code, therefore cannot be done by C++ CLR.
It is also ill suited for C# .
Sounds like a job for C++ extended stored procedure.
But how does one create and deploy an ESP with Visual Studio 2005? All wizards seem to insist on CLR.
Help!?
Boyd
View 2 Replies
View Related
Dec 27, 2005
I just upgraded my SQL 2000 server to SQL2005. I forked out all that money, and now it takes 4~5 seconds for a webpage to load. You can see for yourself. It's pathetic. When I ran SQL2000, i was getting instant results on any webpage. I can't find any tool to optimize the tables or databases. And when I used caused SQL Server to use 100% cpu and 500+MB of ram. I can't have this.Can anyone give me some tips as to why SQL 2005 is so slow?
View 3 Replies
View Related
Jan 4, 2007
Hi
We have Sql2005 x64 bit standard edition server installed in windows 2003 64 bit editio server,
currently due to buisness requirements we need to have sql2005 x64 bit enterprise edition, please let me know how do i do the upgrade or change.
is it possible to retain all our custom settings in the standard edition after changing to enterprise edition.
This has to be done for our production and very critical, please help
Thanks
Samuel I
View 4 Replies
View Related
Feb 4, 2006
Hi
I have new bought the SQL server 2005 enterprise, but it have 2 CDs, so what are the differences between CD1 and CD2? and so which one should i install first? or is it necessary to install both two or just need to install one of them?
And about my original sql 2000 database, can i just attach it's MDF file into the sql 2005 engine, or which import wizard can load the sql 2000 MDF into sql 2005? or do i need to keep the sql 2000 engine before do this?
thx
View 1 Replies
View Related
Sep 19, 2007
I am unable to install 32-bit SQL Server Integration Services on the server due to something that was left behind by the 64-bit version.
I've uninstalled SQL Server 2005 64-bit and when I try to install the 32-bit version of Integration Services, I get this error: "Failed to install and configure assemblies C:Program Files (x86)Microsoft SQL Server90DTSTasksMicrosoft.SqlServer.MSMQTask.dll in the COM+ catalog. Error: -2146233087 Error message: Unknown error 0x80131501 Error descrition: FATAL: Could not find component 'Microsoft.SqlServer.Dts.Task.MessageQueueTask.ServCompMQTask' we just installed."
I can't seem to figure out how to resolve this problem with the COM+ and I can't remember if Integration Services is required.
Can anybody please advise?
View 1 Replies
View Related
Jul 8, 2007
Hello,
I have a vb program that include a dts package that has been saved to vb with sql2000 dts wizard and works very good.
Now that I upgrade my website to sql2005, this vb dts package doesn't work.
The error I get is:
Microsoft Data Transformation Services (DTS) Package
Invalid STDGMEDIUM structure
(Microsoft Data Transformation Services (DTS) Package (80040066): Invalid STDGMEDIUM structure
) (Microsoft SQL-DMO (ODBC SQLState: 42000) (80004005): [Microsoft][ODBC SQL Server Driver][SQL Server]Incorrect syntax near ')'.)
I searched in the internet how to make dts package in sql2005 and save it to vb and found no information about it.
What Can I do to get the vb code of the dts package I create in sql2005 or how do i migrage the sql2000 vb dts package code to sql2005?
Thanks,
Kubyustus
View 4 Replies
View Related
Mar 20, 2014
writing the query for the following, I need to collapse the continuity. If the termdate for an ID is one day less than the effdate of the next id (for the same ID) i need to collapse the records. See below example .....how should i write the query which will give me the desired output. i.e., get min(effdate) and max(termdate) if termdate is one day less than the effdate of next record.
ID effdate termdate
556868 1999-01-01 1999-06-30
556868 1999-07-01 1999-10-31
556869 2002-10-01 2004-01-31
556872 1999-02-01 2000-08-31
556872 2000-11-01 2004-01-31
556872 2004-02-01 2004-02-29
output should be ......
ID effdate termdate
556868 1999-01-01 1999-10-31
556869 2002-10-01 2004-01-31
556872 1999-02-01 2000-08-31
556872 2000-11-01 2004-02-29
View 0 Replies
View Related
Feb 2, 2001
If I have a *.dts file, and want to change the originating server database from SERVERA DB_A to SERVERB DB_B, is there an easy method to do this, besides editing the file in the GUI form?
View 1 Replies
View Related
Jun 16, 2007
I need help transferring a SQL database. I currently have my website database on a SQL 4.0.27 (vdeck) and want to transfer it to a new server (VPS) which has SQL 4.1.2
I have imported the database to my desktop computer. It will not let me import to the new server. I have to edit/reconfigurate.
Any suggestions, comments, advice, help would be greatly appreciated.
Ed
ed.sistrunk@sistrunk.net
View 4 Replies
View Related
Nov 4, 2003
Can I edit database (Tables, SPs, Views,...) with ADO.NET?
View 3 Replies
View Related
Feb 16, 2005
hey guys,
is it possible to add or edit columns once there is data in the tables??
not the data in the columns but the columns themselves..
for example lets say i have a table with 4 columns and for some reason or
another, i want to add a 5th or 6th column after data has already been entered,
like a few months down the line..
View 2 Replies
View Related
Mar 9, 2005
I have scheduled a T-SQL job that runs every morning using Enterprise Manager. Now I want to change the SELECT and UPDATE statements that this job runs, but I can't find anywhere to edit a job that has already been scheduled. Any help would be appreciated.
Thanks
View 1 Replies
View Related
May 6, 2008
I keep getting "cannot update a timestamp column"!! How can I change the timestamp to all zeros? or can I not do that?
JOhn
View 4 Replies
View Related
Nov 16, 2007
Hi
I want to Enable Editing in the GridView
but there is a problem
the GridView take its data from 2 tables and I do this by the
build query
so I can't choose the " advance " button and check for enable update and delete statements
and when I try to build the update query in the update tap
I don't know what to write in the "new value" column
so how can enable editing in the GridView that take from
2 tables???????
please help me
and thanks
View 3 Replies
View Related
Nov 13, 2006
I have some production boxes on Win 2000 32-bits OS and some production servers have been upgraded to Win2003 64-bit OS runing SQL Server 2005. There are also a number of Win2003 32-bit OS running SQL 2005.
The issue is that when linking the 64-bit production servers to the 32-bit boxes running SQL 2005 / Win 2003 OS, the linking seems to succeed, but I am unable to see a number of entries in sys.objects. Typically, these objects are User Stored Procedures.
Moreover, the linking seemed to have worked, but data extraction does not take place between the servers. However, there are no errors. The objects (user stored procs) exist on the 64-bit side, but linking does not actually happen.
Microsoft KB has addressed this in SQL 2000 case in this KB article, but has not suggested a solution for SQL 2005.
Any ideas? Has anyone else encountered this?
Thanks.
View 1 Replies
View Related