|
|
I am having trouble with 3 delete queries in my c# application(Win Mobile database)and MSVS 2005, two other Delete queries run fine. All the Delete queries run fine on Win XP, just not in Vista(Vista's User Account Control off). Here is the simple query
DELETE FROM [tableName] I get error SQL Execution error 3640. I get this error whether I am debugging in msvs2005, or running in the Query Designer or if I just run the application outside of msvs2005.
I posted this in C# but someone mentioned that it might be better posted here.
I can get a Delete Query to work if i use the key columns like
DELETE FROM Horse
WHERE (CODE = @p1) AND (Stable = @p2) AND (HorseName = @p3)
this one is not really useful to me though since I am trying to delete all rows no matter the value in these columns.
Hope someone has an idea.
If not is there any other way I can delete all rows from a data table?
I didn't quite understand how to use TRUNCAT TABLE in the Query Designer in MSVS 2005.
If anyone will accept the database tables to see if they get teh same error I will be happy to send them to you.
Thank you
Jon Stroh
Thank You
Jon Stroh
|
|
|
|
|
THERE IS PHP PROJECT IN WHICH A SMALL CHANGE IS RQUIRED for a PHP coding.those who can able to do the coding please contact me in 9884112963or mail me at haarishg@yahoo.co.in asap
-- modified at 14:16 Tuesday 18th September, 2007
|
|
|
|
|
The forums is not the place for this. Post this stuff on the Jobs Board[^].
|
|
|
|
|
Please stop posting stuff like this. Try RentACoder.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
greetings everyody,
When building an application that utilises a databases such as SQL Server or Sybase SQL Anywhere one can use stored procedures to manipulate the database. For example, I use the follwing bit of code in my DataAccess class:
SACommand cmd = new DataAccessor(m_connectionString).GetCommand("[OrderDetails.UpdateInventory]");
cmd.Parameters.Add(new SAParameter("@Quantity",Quantity));
cmd.Parameters.Add(new SAParameter("@ProductID", ProductID));
cmd.Parameters.Add(new SAParameter("@DistributorID", DistributorID));
cmd.Parameters.Add(new SAParameter("@InventoryReceiptHeaderID", ReceiptID));
cmd.Parameters.Add(new SAParameter("@OrderID", OrderID));
cmd.Parameters.Add(new SAParameter("@DeliveryNote", DeliveryNote));
cmd.Parameters.Add(new SAParameter("@UserID", UserID));
cmd.ExecuteNonQuery();
Problem is MS Access does not have stored procedures.
Now, im trying to avoid typing SQL statements directly in my code. Im hoping to use queries in my MS Access databse which i pass parameters to etc
How can i achieve the same in MS Access 2000/2003 database?
|
|
|
|
|
pete007_ke wrote: Now, im trying to avoid typing SQL statements directly in my code. Im hoping to use queries in my MS Access databse which i pass parameters to etc
How can i achieve the same in MS Access 2000/2003 database?
I have never tried this before, but I'm assuming it could work. In your Access database, you could write your "stored procedures" in VBA. Having your functions stored in the database, I'm pretty sure you could call those functions and get their returns.
I get all the news I need from the weather report - Paul Simon (from "The Only Living Boy in New York")
|
|
|
|
|
I call a certain stored procedure in a loop (all within another SP), for every loop the procedure is executed to another server, some of the servers are very far away and connected on slow VPN lines, the procedures could execute for as long as 4minutes.
How do I set the time-out period to be longer? Since I suspect it's a time-out which causes the procedure to fail to these servers.
I'm implementing something like this:
CREATE PROCEDURE procDistributeData
AS
DECLARE
@main varchar(50),
@child varchar(50),
DECLARE rst CURSOR LOCAL FOR
SELECT MainServerInstance, ChildServerInstance FROM tblServers
OPEN rst
FETCH NEXT FROM rst INTO @main, @child
WHILE @@fetch_status = 0
BEGIN
EXEC procDistributeToServer @main,@child,@error out
Print @error
FETCH NEXT FROM rst INTO @main, @child
END
CLOSE rst
DEALLOCATE rst
|
|
|
|
|
Would it be possible to rearchitect this slightly? For instance, you may just want to trigger the task to run on the remote server via DTS somehow.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Are you suggesting doing something like a "PULL" of the data from the main server?
Doing it my way means I have central control of the data distribution.
I know how to set a stored procedure's time-out when calling it from, say, VB code, but I don't know how to do it within another stored procedure.
|
|
|
|
|
Without knowing what your architecture/problem is then I can't say. I'm just suggesting that you might be able to use different ways to do this.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Ok, basically I have a main server and many "child servers" connected via VPN.
On the main server there exists a table which has to be replicated daily to all the child servers to keep them synchronized.
SQL's replication is not an option here for many reason I'm not going into right now.
But when I execute one SP within another, a time-out occurs (I think) on when updating some child servers. If I execute the SP seperately (not from another SP) it works fine, even though it runs for more than 3minutes.
|
|
|
|
|
Hi,
I just wanted to know if there are any 3rd party tools available that provide the user with an interface similar to that of SQL Builder which can be used with a windows application to allow the end user to design his own reports.
Thanks
|
|
|
|
|
Never give an end-user that kind of control/options, they'll find some way of mocking up.
I had a quick look and it seems Oppen Office has something[^] similar to what you described.
Sorry if it's not spot on, I don't know of any tool that is simple enough for end users to use.
|
|
|
|
|
hi all
i want to create query which gives me
1) all Table name of the selected Database
2) all fields name of selected Table
thanks in advance
The Stifler
--
Bugs can neither be created nor be removed from software by a developer. They can only be converted from one form to another. The total number of bugs in the software always remain constant.
|
|
|
|
|
Assuming you are talking about SQL Server
The Stifler wrote: 1) all Table name of the selected Database
SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE='BASE TABLE'
The Stifler wrote: 2) all fields name of selected Table
SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'MyTableName'
|
|
|
|
|
Thanks Colin
The Stifler
--
Bugs can neither be created nor be removed from software by a developer. They can only be converted from one form to another. The total number of bugs in the software always remain constant.
|
|
|
|
|
|
hi thanks again for last solution can u please help me
1) How to get all databases name
3) How to get all databases name from selected server .
Thanks in advance
The Stifler
--
Bugs can neither be created nor be removed from software by a developer. They can only be converted from one form to another. The total number of bugs in the software always remain constant.
|
|
|
|
|
The Stifler wrote: 1) How to get all databases name
See sys.databases[^]
e.g. SELECT * FROM sys.databases
The Stifler wrote: 3) How to get all databases name from selected server .
Question 2 appears to be missing.
You must log on to the server in order to enumerate the databases on it.
|
|
|
|
|
Hi
I have been trying to connect to a sql server database that is on my machine. I am using Visual Studio 2005. Every time I try connect I get an error message that states that the Login was invalid. I am getting this error msg.
System.Data.SqlClient.SqlException was unhandled
Class=14
ErrorCode=-2146232060
LineNumber=0
Message="Login failed for user 'sa'."
Number=18456
Procedure=""
Server="chiko-shumba"
Source=".Net SqlClient Data Provider"
State=1
This is connection string that I am using.
cstring = "Persist Security Info=False;User ID=sa;Password=bobsurunlce;Initial Catalog=ymca_data;Server= chiko-shumba"
I created my database using sql server 2000, and I assigned a usere name and password, when I installed sql server. What could I Have done wrong, and what can I do to get round this?
thanks in advance
twsted F8
|
|
|
|
|
twsted f8 wrote: Connecting to SQL express
twsted f8 wrote: I created my database using sql server 2000, and I assigned a usere name and password, when I installed sql server. What could I Have done wrong, and what can I do to get round this?
Okay. So, you created the database in SQL Server 2000, but have since moved it to SQL Server 2005 Express (the is no express edition for SQL Server 2000).
The sa password you set in SQL Server 2000 won't apply in SQL Server 2005 as the login details are managed by the server not the individual databases. So you have to use what ever credentials were set up when you installed SQL Server 2005 Express Edition.
It's been a while since I tried to install that edition but as I recall it doesn't ask you, it just sets up trusted connections automatically. I may be wrong so you might want to check.
|
|
|
|
|
With SQL express you are going to have to allow access via TCP/IP from the SQL Server Configuration Manager.
|
|
|
|
|
Hi,
I have the foll prob.. I need to create a report which will have an a total at the end of each page followed by a grand total at th end of the report. There are no groupings in the data. i am able to achieve individual totals by placing the sum in the page footer but the prob is that on the last page the page total appears after the grand total... any help appreciated
|
|
|
|
|
Haven't tried this myself, but you should be able to toggle the visibility of the page total textbox based on the result of an expression that checks whether the current page number is equal to the total number of pages in the report. If they are equal, hide the textbox. If they are not, show it.
Paul
|
|
|
|