Many To Many Relationship - What's Best Way To Add/edit/delete

Aug 3, 2006

I have a many to many relationship

I can design the table 2 ways:

1) Category table (cat_id, cat_name, active) - cat_id as PK
CategoryReq (cat_id, req_name) - cat_id & req_name as PK

2)
CategoryReq (req_name, cat_name) - req_name & cat_name as PK

If
I design 1st way. Then when they want to add and delete from the
CategoryRequest table, they would have to add to the category table
first. Then maybe build a list of checkboxes to select from. The one's
they check insert into the CategoryRequest table.

Drawback of
this is that they can't edit the list on the fly. Since it may be used
by other request (since cat_id CategoryReq is fk into Category table)

If I design it the 2nd way. Then they can edit, delete, add on the fly. But there won't be a master category list.

Which way is better?

View 1 Replies


ADVERTISEMENT

Delete Relationship?

Sep 20, 2005

How do I delete a relationship between tables in SQL Server 7.0?I previously had a relationship between two tables, but I renamed the fieldand table of one of the tables and the old relationship still points to theold field name and table. How do I remove the defunct relationship?It doesn't show in my diagram because the old table no longer exists (wellit does but it's been renamed).

View 2 Replies View Related

Need Help~for Edit, Delete The Existing Query And Diagram In Database~

Apr 8, 2008

anyone know how to delete diagram in database that show relationship between tables?or anyone know how to open the existing relation diagram and existing query in database?wonder why my sqlexpress which come wit visual basic web developer 2005 only hav new query button and new diagram button~dont have edit exisiting diagram or edit existing query~==.=~~hope someone help me~ 

View 3 Replies View Related

How Can I Change The Read-only Database For Add, Edit And Delete Users?

Jan 25, 2006

Sorry about my English, it is not my natural language and thanks for your help. I have installed the Personal Site Starter Kit, everything work perfect except register users. When a new user try to register as a new user he receives an error, caused because the database is "read-only". In IIS the database has read and writing permissions and the directories where the aplication is. How can I change the database permissions?

Server Error in '/personalweb' Application.


Failed to update database "C:INETPUBWWWROOTPERSONALWEBAPP_DATAASPNETDB.MDF" because the database is read-only.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Data.SqlClient.SqlException: Failed to update database "C:INETPUBWWWROOTPERSONALWEBAPP_DATAASPNETDB.MDF" because the database is read-only.Source Error:



An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. Stack Trace:



[SqlException (0x80131904): Failed to update database "C:INETPUBWWWROOTPERSONALWEBAPP_DATAASPNETDB.MDF" because the database is read-only.]
System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) +857466
System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +735078
System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +188
System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +1838
System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString) +149
System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async) +886
System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result) +132
System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe) +415
System.Data.SqlClient.SqlCommand.ExecuteNonQuery() +135
System.Web.Security.SqlMembershipProvider.CreateUser(String username, String password, String email, String passwordQuestion, String passwordAnswer, Boolean isApproved, Object providerUserKey, MembershipCreateStatus& status) +3612
System.Web.UI.WebControls.CreateUserWizard.AttemptCreateUser() +305
System.Web.UI.WebControls.CreateUserWizard.OnNextButtonClick(WizardNavigationEventArgs e) +105
System.Web.UI.WebControls.Wizard.OnBubbleEvent(Object source, EventArgs e) +453
System.Web.UI.WebControls.CreateUserWizard.OnBubbleEvent(Object source, EventArgs e) +149
System.Web.UI.WebControls.WizardChildTable.OnBubbleEvent(Object source, EventArgs args) +17
System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +35
System.Web.UI.WebControls.Button.OnCommand(CommandEventArgs e) +115
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +163
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5102



Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.42

View 1 Replies View Related

Implementing Edit And Delete Operations Using Templatefields In GridView

Aug 9, 2007

Hi!
I want to customize the Edit And Delete Operations of a gridview using Image Button Controls.Please suggest me the way to implement that.

One more Problem I am facing is,Image button doesn't fire the RowCommand Event of GridView whereas when I use the Link button that event is firing.

Thanks

View 3 Replies View Related

SQL Server 2000 Permissions For GridView Edit/Delete Functions

Feb 16, 2007

I have a SQLDataSource that gets it's data from a SQL 2000 database table.  I have configured it to generate the Update/Delete commands, which look correct.  I then have a GridView that is using this SqlDataSource to show the data with "Edit" & "Delete" buttons (the default ones from the GridView).
My problem is that while all commands (Edit, Delete) work on my local server, they do NOT work on my live server.  In my connection string, I specifiy a username and password like this:

<add name="Project_Management.My.MySettings.WebReportsConnectionString"
connectionString="Data Source=Karlweb;Initial Catalog=WebReport;Persist Security Info=True;User ID=VbUser;Password=VbUser"
providerName="System.Data.SqlClient" />
I have access to change the permissions on my production server, so I gave this "VbUser" every allow permission I could find and still I could not Edit or Delete records.  What I mean by they "do not work" is that when I click the Edit button, the GridView switches to edit mode, but when I click Update, the changes are not written.  When I click the Delete button, the page just refreshes and the record is not deleted.
As this is working on my local server, I think the problem lies in some permission or configuration of the server.  Does anyone have any suggestions of where I could look or what to change?
Thank you!

View 3 Replies View Related

Add/Edit/Delete Records With Remote SQL Server 2000 Database

Dec 2, 2007

Using ASP.net 2.0 or Visual Web Developer Edition 2005 I could not find a single example with Datagrid Control or Form View Control, to achieve the basic functionality ofAdd/Edit/Delete Records with Remote SQL Server 2000 Database. When I searched for these examples I found many videos and examples using local database and in learning path of Visual web express editions, very goodexamples and videos using local SQL Server 2005 database, BUT not with the remote database.
My question Is it possible to get the basic functionality of Add/Edit/Delete Records with Remote SQL Server 2000 Database using ASP.Net 2.0 Datagrid and FormView controls?
This question looks like, a lazy developer question!! but, in my learning path I found GREAT videos in Visual Studio Web Developer Express edition and learned simple way of drag and drop the controls assign create local database and their connections, and few clicks to add/edit/delete records using datagrid and formview controls. In real life those are not much useful because many of web interfaces are with sql server 2000 and we need to convert them into ASP.Net. Similarly I wanted to drag and drop couple of controls and less coding etc. and accomplish basic functionality of add/edit/delete records using remote database sql server 2000.
If possible please help me out.
Wondering is it possible to get the functionality of add/edit/delete records using datagrid/formview with remote sql server 2000, the way they explained in bigginers learning videos ... I am referring to (http://msdn2.microsoft.com/en-us/express/aa700802.aspx)
If possible and you think it is possible please guide me to that URL where I can learn the great functionalty n implement..!!

View 1 Replies View Related

How Can I Create A One-to-one Relationship In A SQL Server Management Studio Express Relationship Diagram?

Mar 25, 2006

How can I create a one-to-one relationship in a SQL Server Management Studio Express Relationship diagram?

For example:
I have 2 tables, tbl1 and tbl2.

tbl1 has the following columns:
id {uniqueidentifier} as PK
name {nvarchar(50)}

tbl2 has the following columns:
id {uniqueidentifier} as PK
name {nvarchar(50)}
tbl1_id {uniqueidentifier} as FK linked to tbl1.id


If I drag and drop the tbl1.id column to tbl2 I end up with a one-to-many relationship. How do I create a one-to-one relationship instead?

mradlmaier

View 3 Replies View Related

Power Pivot :: Use Relationship Not Overriding Conflicting Active Relationship?

Oct 14, 2015

I have four tables with relationships as shown. They have a circular relationship and so one of the relationships is forced to be inactive.

   Operation (Commodity, OperationKey)   ==========> 
Commodity (Commodity)
                      /                                                                        
/
                       |                                                                         
|
   Advice (OperationKey)       ====== (inactive)=======>
Operation Commmodity (Commodity, OperationKey)

I have the following measure:

Advice No. Commodity:=CALCULATE (
COUNTROWS ( 'Advice' ),
USERELATIONSHIP(Advice[OperationKey],'Operation Commodity'[OperationKey]),
operation
)

However, the userelationship function does not override the active relationship between Operation & Advice and so the measure is limited to Advices directly filtered by the Operation table.

If I delete the relationship between Operation and Advice, then the measure works as expected i.e. Operation indirectly filters Operation Commodity which filters Advice.

View 9 Replies View Related

SQL Server 2008 :: Maintenance Plan Delete History Trying To Delete Wrong Files

Sep 11, 2015

I have some simple files but they are failing because the delete history task is failing as it is looking for files in a non existent directory.

It is looking for files in C:Program FilesMicrosoft SQL ServerMSSQL10_50.INSTANCEMSSQLLog whereas it should be looking in C:Program FilesMicrosoft SQL ServerMSSQL10_50.MSSQLSERVERMSSQLLog

how I can get this corrected so I can get the Maintenance Plans to run correctly.

I have tried deleting and recreating the Plan but to no avail

View 0 Replies View Related

Master Data Services :: Hard Delete All Soft Delete Records (members) In Database

May 19, 2012

I am using Master Data Service for couple of months now. I can load, update, merge and soft delete data in MDS. Occasionally we even have to hard delete data from MDS. If we keep on soft deleting records in a MDS table eventually there will be huge number of soft deleted records. Is there an easy way to hard delete all the soft deleted records from all MDS tables in a specific Model.

View 18 Replies View Related

Copy And Delete Table With Foreign Key References(...,...) On Delete Cascade?

Oct 23, 2004

Hello:
Need some serious help with this one...

Background:
Am working on completing an ORM that can not only handles CRUD actions -- but that can also updates the structure of a table transparently when the class defs change. Reason for this is that I can't get the SQL scripts that would work for updating a software on SqlServer to be portable to other DBMS systems. Doing it by code, rather than SQL batch has a chance of making cross-platform, updateable, software...

Anyway, because it needs to be cross-DBMS capable, the constraints are that the system used must work for the lowest common denominator....ie, a 'recipe' of steps that will work on all DBMS's.

The Problem:
There might be simpler ways to do this with SqlServer (all ears :-) - just in case I can't make it cross platform right now) but, with simplistic DBMS's (SqlLite, etc) there is no way to ALTER table once formed: one has to COPY the Table to a new TMP name, adding a Column in the process, then delete the original, then rename the TMP to the original name.

This appears possible in SqlServer too --...as long as there are no CASCADE operations.
Truncate table doesn't seem to be the solution, nor drop, as they all seem to trigger a Cascade delete in the Foreign Table.

So -- please correct me if I am wrong here -- it appears that the operations would be
along the lines of:
a) Remove the Foreign Key references
b) Copy the table structure, and make a new temp table, adding the column
c) Copy the data over
d) Add the FK relations, that used to be in the first table, to the new table
e) Delete the original
f) Done?

The questions are:
a) How does one alter a table to REMOVE the Foreign Key References part, if it has no 'name'.
b) Anyone know of a good clean way to get, and save these constraints to reapply them to the new table. Hopefully with some cross platform ADO.NET solution? GetSchema etc appears to me to be very dbms dependant?
c) ANY and all tips on things I might run into later that I have not mentioned, are also greatly appreciated.

Thanks!
Sky

View 1 Replies View Related

SQL - Cascading Delete, Or Delete Trigger, Maintaining Referential Integrity - PLEASE HELP ME!!!

Nov 13, 2006

I am having great difficulty with cascading deletes, delete triggers and referential integrity.

The database is in First Normal Form.

I have some tables that are child tables with two foreign keyes to two different parent tables, for example:

Table A
/
Table B Table C
/
Table D

So if I try to turn on cascading deletes for A/B, A/C, B/D and C/D relationships, I get an error that I cannot have cascading delete because it would create multiple cascade paths. I do understand why this is happening. If I delete a row in Table A, I want it to delete child rows in Table B and table C, and then child rows in table D as well. But if I delete a row in Table C, I want it to delete child rows in Table D, and if I delete a row in Table B, I want it to also delete child rows in Table D.

SQL sees this as cyclical, because if I delete a row in table A, both table B and table C would try to delete their child rows in table D.

Ok, so I thought, no biggie, I'll just use delete triggers. So I created delete triggers that will delete child rows in table B and table C when deleting a row in table A. Then I created triggers in both Table B and Table C that would delete child rows in Table D.

When I try to delete a row in table A, B or C, I get the error "Delete Statement Conflicted with COLUMN REFERENCE". This does not make sense to me, can anyone explain? I have a trigger in place that should be deleting the child rows before it attempts to delete the parent row...isn't that the whole point of delete triggers?????

This is an example of my delete trigger:

CREATE TRIGGER [DeleteA] ON A
FOR DELETE
AS
Delete from B where MeetingID = ID;
Delete from C where MeetingID = ID;

And then Table B and C both have delete triggers to delete child rows in table D. But it never gets to that point, none of the triggers execute because the above error happens first.

So if I then go into the relationships, and deselect the option for "Enforce relationship for INSERTs and UPDATEs" these triggers all work just fine. Only problem is that now I have no referential integrity and I can simply create unrestrained child rows that do not reference actual foreign keys in the parent table.

So the question is, how do I maintain referential integrity and also have the database delete child rows, keeping in mind that the cascading deletes will not work because of the multiple cascade paths (which are certainly required).

Hope this makes sense...
Thanks,
Josh


View 6 Replies View Related

Delete Syntax To Delete A Record From One Table If A Matching Value Isn't Found In Another

Nov 17, 2006

I'm trying to clean up a database design and I'm in a situation to where two tables need a FK but since it didn't exist before there are orphaned records.

Tables are:

Brokers and it's PK is BID

The 2nd table is Broker_Rates which also has a BID table.

I'm trying to figure out a t-sql statement that will parse through all the recrods in the Broker_Rates table and delete the record if there isn't a match for the BID record in the brokers table.

I know this isn't correct syntax but should hopefully clear up what I'm asking

DELETE FROM Broker_Rates

WHERE (Broker_Rates.BID <> Broker.BID)

Thanks

View 6 Replies View Related

I Use SQL 2000, Can You Use One Delete Query To Delete 2 Tables?

Nov 26, 2007

this is my Delete Query NO 1
alter table ZT_Master disable trigger All
Delete ZT_Master WHERE TDateTime> = DATEADD(month,DATEDIFF(month,0,getdate())-(select Keepmonths from ZT_KeepMonths where id =1),0) AND TDateTime< DATEADD(month,DATEDIFF(month,0,getdate()),0)
alter table ZT_Master enable trigger All
 
I have troble in Delete Query No 2
here is a select statemnt , I need to delete them
select d.* from ZT_Master m, ZT_Detail d where (m.Prikey=d.MasterKey)  And m.TDateTime> = DATEADD(month,DATEDIFF(month,0,getdate())-(select Keepmonths from ZT_KeepMonths where id =1),0) AND m.TDateTime< DATEADD(month,DATEDIFF(month,0,getdate()),0)
I tried modified it as below
delete d.* from ZT_Master m, ZT_Detail d where (m.Prikey=d.MasterKey)  And m.TDateTime> = DATEADD(month,DATEDIFF(month,0,getdate())-(select Keepmonths from ZT_KeepMonths where id =1),0) AND m.TDateTime< DATEADD(month,DATEDIFF(month,0,getdate()),0)
but this doesn't works..
 
can you please help?
and can I combine these 2 SQL Query into one Sql Query? thank you

View 1 Replies View Related

How To Run Delete Query / Delete Several Rows Just By One Click ?

Feb 16, 2008

I'm using SqlDataSource and an Access database. Let's say I got two tables:user: userID, usernamemessage: userID, messagetextLet's say a user can register on my website, and leave several messages there. I have an admin page where I can select a user and delete all of his messages just by clicking one button.What would be the best (and easiest) way to make this?Here's my suggestion:I have made a "delete query" (with userID as parameter) in MS Access. It deletes all messages of a user when I type in the userID and click ok.Would it be possible to do this on my ASP.net page? If yes, what would the script look like?(yes, it is a newbie question) 

View 2 Replies View Related

Allow Single Row Delete From A Table But Not Bulk Delete

Sep 16, 2013

The requirement is: I should allow single row delete from a table but not bulk delete. An audit table should get updated if there is any single delete or single update. So I wrote the triggers as follows: for single and bulk delete

ALTER TRIGGER [dbo].[TRG_Delete_Bulk_tbl_attendance]
ON [dbo].[tbl_attendance]
AFTER DELETE
AS

[code]...

When I try to run the website, the database error I am getting is:Transaction count after EXECUTE indicates that a COMMIT or ROLLBACK TRANSACTION statement is missing. Previous count = 0, current count = 1.

View 3 Replies View Related

Delete Doesn't Delete Rows, But @@ROWCOUNT Says It Did

Aug 20, 2007

I ran the following query in Query Analyzer on a machine running SQL Server 2000. I'm attempting to delete from a linked server running SQL Server 2005:

DELETE FROM sql2005.production.dbo.products
WHERE vendor='Foo'
AND productId NOT IN
(
SELECT productId FROM sql2000.staging.dbo.fooProductList
)

The status message (and @@ROWCOUNT) told me 8 rows were affected, but nothing was actually deleted; when I ran a SELECT with the same criteria as the DELETE, all 8 rows are still there. So, once more I tried the DELETE command. This time it told me 7 rows were affected; when I ran the SELECT again, 5 of the rows were still there. Finally, after running this exact same DELETE query 5 times, I was able to remove all 8 rows. Each time it would tell me that a different number of rows had been deleted, and in no case was that number accurate.

I've never seen anything like this before. Neither of the tables involved were undergoing any other changes. There's no replication going on, or anything else that should introduce any delays. And I run queries like this all day, involving every thinkable combination of 2000 and 2005 servers, that don't give me any trouble.

Does anyone have suggestions on what might cause this sort of behavior?

View 3 Replies View Related

Cannot Amend Or Delete Subscription And Cannot Delete Report.

Nov 20, 2007



Hi,

I have a problem with one report on my server. A user has requested that I exclude him from receiving a timed email subscription to several reports. I was able to amend all the subscriptions except one. When I try to remove his email address from the subscription I receive this error:

An internal error occurred on the report server. See the error log for more details. (rsInternalError) Get Online Help







For more information about this error navigate to the report server on the local server machine, or enable remote errors


Online no help couldn't offer any advice at all, so I thought I'd just delete the subscription and recreate it again, but I receive the same message. "Okay, no problem, I'll just delete the report and redeploy it and set up the subscription so all the other users aren't affected", says I. "Oh, no!", says the report server, and then it give me this message:





System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.Data.SqlClient.SqlException: Only members of sysadmin role are allowed to update or delete jobs owned by a different login. at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString) at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async) at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result) at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe) at System.Data.SqlClient.SqlCommand.ExecuteNonQuery() at Microsoft.ReportingServices.Library.InstrumentedSqlCommand.ExecuteNonQuery() at Microsoft.ReportingServices.Library.DBInterface.DeleteObject(String objectName) at Microsoft.ReportingServices.Library.RSService._DeleteItem(String item) at Microsoft.ReportingServices.Library.RSService.ExecuteBatch(Guid batchId) at Microsoft.ReportingServices.WebServer.ReportingService2005.ExecuteBatch() --- End of inner exception stack trace ---



What's even weirder is that I'm the owner and creator of the report and I'm a system admin and content manager on the report server and I set up the subscription when the report was initially deployed. Surely I should have sufficient rights to fart around with this subscription/report as I see fit?

I have rebooted the server, redeployed the report, checked credentials on the data source and tried amending and deleting from both the report manager and management studio but still I am prevented from doing so.

Any help would be much appreciated.

Thanks in advance,

Paul

View 3 Replies View Related

Edit Sql

Dec 7, 2006

Edski writes "Help please,
below is my sql query, when I run it, I get the right result with one problem. I get same customers with same email many times. I would only like the same customer shown one time. Checking it by email.


SELECT od.pName, od.dIndx AS dindx, od.pIndx AS pindx, od.device AS device, c.Cust_Id AS cust_id,

c.First_Name AS First_name,

c.Last_Name AS last_name, c.Email AS Email, c.Phone AS phone,c.company, h.productCode AS

product_code, DATEDIFF(dd, GETDATE(), h.expirationDate)

AS Difference, h.hotSyncId AS regcode, od.autorenewal AS autorenewal, od.installment AS

installment

FROM Orders_Detail od INNER JOIN

Hot_Sync_ID h ON od.dIndx = h.dIndx INNER JOIN

Customers c ON c.Cust_Id = h.cust_id

WHERE (od.prenewal ='False') and (od.autorenewal = 'no') and (c.newsletter <> 0) AND

(DATEDIFF(dd, GETDATE(), h.expirationDate) = '27') AND (c.company <> 'University of Alberta')

ORDER BY difference, c.Last_Name, h.productCode"

View 2 Replies View Related

How Can I Edit An SQL Database?

Oct 9, 2004

Hello,

I have been working in ASP.Net web sites with Access database.

Now I want to create a web site using an MS SQL database.

What software or softwares can I use to create and edit MS SQL databases?

I am using Windows XP Professional SP2.

Thank You,
Miguel

View 5 Replies View Related

Pb To Edit A Recordset With VB In A DTS

Nov 24, 2001

Hello,

I have some problems to edit a recordset in an ActiveX DTS using Vbscript.
Here is an example of the script :

dim varsql, varset, varconn
set varconn = CreateObject("ADODB.Connection")
set varset = CreateObject("ADODB.Recordset")
varconn.Open = "Provider=SQLOLEDB.1;Data Source=(local);Initial Catalog=Enregistrement3;user id = 'sa';password=''"

varsql = "SELECT * "
varsql = varsql & "FROM mytable "
varset.Open varsql, varconn, 3,3

msgbox "How much : " & varset.recordcount

if varset.recordcount >0 then
do while varset.eof
varset.edit
.........................
varset.update
varset.movenext
loop
end if
varset.close
varconn.close

Does someone see what is wrong ?
I allways get -1 for the varset.recordcount ! (I checked there are some records into the table).
I don't think it is a problem of user's right as it works with the same user configuration using a SQL action requery.
If I modify the open statement like this :
varset.Open varsql, varconn, 1
varset.recordcount contains the good number of records but the recordset is read noly and can't be modified...

Any Help will be very wellcome !
TIA

View 1 Replies View Related

How To Edit A SQL DB Via MS Access?

Aug 23, 2000

This is a basic, remedial question, but I've no experience whatsoever with SQL server or Access (although I'm familiar with basic DB concepts). Even so, I have inherited this project because no one else will take it (besides, I like the challenge of learning something new :-). If I understand correctly, I can use Access 2000 to create and edit DBs on my SQL 7 server, and to run queries. This is done by creating a WBEM ODBC connector (I have no idea how this is done). I'm pretty good at figuring things out on my own, but I sure would appreciate being pointed in the right direction. What I'd like to know is first of all, am I on the right track, and secondly, what do you all recommend as a good source of info on this topic (the Microsoft web site, technet, manuals?).

All info is greatly appreciated.

thanx,
-scott

View 3 Replies View Related

Edit Web Assistant Job

Oct 25, 2005

Where do I go to modify the T-SQL statement I entered while creating a job with the web assistant wizard?

View 1 Replies View Related

Help Again Edit Parameters From MDB To ADP

Jan 31, 2006

I need to convert this from Jet SqL to SQL Server. Moving out of an MDB to an ADP some of the queries I need to change over, I inherited this database and the bosses want all databases moved over from MDB to ADP.


SELECT Format$([Main Table].Date,'mmmm yyyy') AS [Date By Month], [Main Table].[Action Type], Count([Main Table].[Action Type]) AS [CountOfAction Type]
FROM [Main Table]
GROUP BY Format$([Main Table].Date,'mmmm yyyy'), [Main Table].[Action Type]
HAVING (((Format$([Main Table].[Date],'mmmm yyyy'))=[Enter the Month and the Year]));

View 1 Replies View Related

Last Edit Time?

Jul 23, 2005

How can i mark a row with its last edit time?With access it was obvious, in sqlserver?

View 1 Replies View Related

Edit .mdf Database

Jul 23, 2005

Greetings,Are there any tools freely available to modify or edit a .mdf databasefile? As far as seeing the actual tables?Regards,cd

View 6 Replies View Related

Edit Distance

Mar 18, 2008

Hi,
please, it is possible to know the edit distance used in the fuzzy lookup/grouping.
On this forum I read fuzzy lookup use 4-gram with fix size.
Does exist any document explaining how fuzzy lookup calculate the similarity? In other word, what kind of edit distance, algorithm is used by fuzzy lookup/grouping?
I hope I was enough clear with my poor english.
Thanks All

View 1 Replies View Related

Cannot Edit Jobs

Sep 3, 2007



Two days back we have installed SP2 on SQLServer2005 Active/Active Cluster which result in failure.

Only Database Services and Analysis Services where not updated and rest of the services got updated.

After a restart , the behaviour of SQLServer is helarious.

We got into lot of problem so we opened support from Microsoft.

One of the problem i forgot to mentioed to Microsoft was on editing the Job i cannot see anything inside,all the entries where empty closing the job window and opening it again i got all my entries back but on editing i got the below mentioned Error.
Error:
Creating an instance of the COM component with CLSID {E80FE1DB-D1AA-4D6B-BA7E-040D424A925C} from the IClassFactory failed due to the following error:c001f011(Microsoft.SqlServer.ManagedDTS)

If anyone faced the same problem and got any resolution please let me know.

Anyhelp will be appriciated.



View 2 Replies View Related

How To Edit Stored Procedures ?

Apr 27, 2007

I have two questions:
 
1) Is it possible to rename a SQL table –or- copy the content of a table into a new table ?
 
2) How to replace the renamed or replaced table name inside the code of Stored Procedures that references it ?

View 2 Replies View Related

Edit SQL Identity Seed

Jan 9, 2004

Because of testing and deletion, my table of user groups starts at 15 or so. Now I want to insert a group for administrators but I would like to have the groupID be 1. I tried to turn off the identity seed property and insert it manually but that didn't work.

Is there any way to do this?

Thanks, Dave

View 3 Replies View Related

Sql MSDE Table Edit

Oct 23, 2004

I have a table with data in it. Now I want to change the Data Type from int to varchar. Is there anyway to do this because I don't want to delete all the data and re-enter it. That seems to be the only way I can see to change the data type. I would appreciate some help. thanks.

View 10 Replies View Related

Edit Function In DetailsView

May 1, 2006

Hello
Am developing a web site using ASP.net 2.0. I have page to manage the employees information in term of viewing, inserting and updating. The problem is that the updating part doesn't work and it didn't give me any error messages.
My code is as following:
<%@ Page Language="VB" AutoEventWireup="false"%>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Untitled Page</title>
</head>
<script runat="server" >
   
    Protected Sub DetailsView1_ItemInserted(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DetailsViewInsertedEventArgs)
   
        If (Not e.Exception Is Nothing) Then
 
            ErrorMessageLabel.Text = "An error occured while entering this record.  Please verify you have entered data in the correct format."
            e.ExceptionHandled = True
        End If
        GridView1.DataBind()
    End Sub
 
    Protected Sub DetailsView1_ItemUpdated(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DetailsViewUpdatedEventArgs)
   
        GridView1.DataBind()
    End Sub
 
    Protected Sub DropDownList1_SelectedIndexChanged(ByVal sender As Object, ByVal e As EventArgs)
    
        DetailsView1.ChangeMode(DetailsViewMode.ReadOnly)
    End Sub
 
    Protected Sub GridView1_SelectedIndexChanged(ByVal sender As Object, ByVal e As EventArgs)
   
        DetailsView1.ChangeMode(DetailsViewMode.ReadOnly)
    End Sub
 
    Protected Sub GridView1_PageIndexChanged(ByVal sender As Object, ByVal e As EventArgs)
   
        DetailsView1.ChangeMode(DetailsViewMode.ReadOnly)
    End Sub
 
    Protected Sub GridView1_Sorted(ByVal sender As Object, ByVal e As System.EventArgs)
        DetailsView1.ChangeMode(DetailsViewMode.ReadOnly)
    End Sub
   
</script>
<body dir="rtl">
    <form id="form1" runat="server">
        <br />
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:warehouse DBConnectionString2 %>"
            ProviderName="<%$ ConnectionStrings:warehouse DBConnectionString2.ProviderName %>"
            SelectCommand="SELECT DISTINCT [dep_Code], [dep_Name], [BRN_Code] FROM [Departments]"></asp:SqlDataSource>
       
        <asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:warehouse DBConnectionString2 %>"
            ProviderName="<%$ ConnectionStrings:warehouse DBConnectionString2.ProviderName %>"
            SelectCommand="SELECT DISTINCT [ID], [Name],[Position], [DEPT_Code] FROM [Employees]
            where [DEPT_Code]=@dep_Name">
        <SelectParameters>
        <asp:ControlParameter ControlID="DropDownList1" Name="dep_Name" Type="Int32" />
        </SelectParameters>
        </asp:SqlDataSource>
       
        <asp:SqlDataSource ID="SqlDataSource3" runat="server" ConnectionString="<%$ ConnectionStrings:warehouse DBConnectionString2 %>"
            ProviderName="<%$ ConnectionStrings:warehouse DBConnectionString2.ProviderName %>"
            SelectCommand="SELECT DISTINCT [ID], [Authentication], [Name], [Password], [Position], [DEPT_Code], [Contact] FROM [Employees]
            where [ID]=@ID "
           
            UpdateCommand="UPDATE [Employees]
                           SET
                           [ID] = @ID,
                             [Authentication]=@Authentication,
                             [Name]=@Name,
                             [Password]=@Password,
                           [Position]=@Position,
                             [DEPT_Code]=@DEPT_Code,
                             [Contact]=@Contact
                           WHERE [ID] = @ID  "
                           
            InsertCommand="INSERT INTO [Employees]
                   ([ID], [Authentication], [Name], [Password], [Position], [DEPT_Code], [Contact])
            Values (@ID, @Authentication, @Name, @Password, @Position, @DEPT_Code, @Contact) "
            >
        <SelectParameters>
        <asp:ControlParameter ControlID="GridView1" Name="ID" Type="Int32"  PropertyName="SelectedValue" />
        </SelectParameters>
       
        <UpdateParameters>
        <asp:Parameter Name="ID" Type="Int32" />
        <asp:Parameter Name="Authentication" Type="Int16" />
        <asp:Parameter Name="Name" Type="String" />
        <asp:Parameter Name="Password" Type="String" />
        <asp:Parameter Name="Position" Type="String" />
        <asp:Parameter Name="DEPT_Code" Type="Int32" />
        <asp:Parameter Name="Contact" Type="String" />
        </UpdateParameters>
       
        <InsertParameters>
        <asp:Parameter Name="ID" Type="Int32" />
        <asp:Parameter Name="Authentication" Type="Int16" />
        <asp:Parameter Name="Name" Type="String" />
        <asp:Parameter Name="Password" Type="String" />
        <asp:Parameter Name="Position" Type="String" />
        <asp:Parameter Name="DEPT_Code" Type="Int32" />
        <asp:Parameter Name="Contact" Type="String" />
        </InsertParameters>
        </asp:SqlDataSource>
        &nbsp;
        <br />
        <br />
        أختر القسم :&nbsp;
        <asp:DropDownList ID="DropDownList1" DataSourceID="SqlDataSource1" AutoPostBack="True"
      DataTextField="dep_Name" runat="server" DataValueField="dep_Code" OnSelectedIndexChanged="DropDownList1_SelectedIndexChanged" >
        <asp:ListItem></asp:ListItem>
    </asp:DropDownList>
        <table >
            <tr>
                <td style="width: 100px">
                </td>
                <td style="width: 100px">
                </td>
            </tr>
            <tr>
                <td style="width: 100px; height: 154px" valign="top">
                    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataKeyNames="ID"
                        DataSourceID="SqlDataSource2" AllowPaging="True" AllowSorting="True" OnSelectedIndexChanged="GridView1_SelectedIndexChanged" OnPageIndexChanged="GridView1_PageIndexChanged">
                        <Columns>
                            <asp:BoundField DataField="ID" HeaderText="ID" ReadOnly="True" SortExpression="ID" />
                           
                            <asp:BoundField DataField="Name" HeaderText="Name" SortExpression="Name" />
                            <asp:BoundField DataField="Position" HeaderText="Position" SortExpression="Position" />
                            <asp:BoundField DataField="DEPT_Code" HeaderText="DEPT_Code" SortExpression="DEPT_Code" Visible="False" />
                           
                            <asp:CommandField ShowSelectButton="True" />
                        </Columns>
                    </asp:GridView>
                </td>
                <td style="width: 100px; height: 154px" valign="top">
                    <asp:DetailsView ID="DetailsView1" runat="server" AutoGenerateRows="False" DataKeyNames="ID" OnItemUpdated="DetailsView1_ItemUpdated"
                        DataSourceID="SqlDataSource3" Height="50px" Width="125px" AllowPaging="True" OnItemInserted="DetailsView1_ItemInserted">
                        <Fields>
                            <asp:BoundField DataField="ID" HeaderText="ID" ReadOnly="True" SortExpression="ID" />
                            <asp:BoundField DataField="Name" HeaderText="Name" SortExpression="Name" />
                            <asp:BoundField DataField="Password" HeaderText="Password" SortExpression="Password" />
                            <asp:BoundField DataField="Position" HeaderText="Position" SortExpression="Position" />
                            <asp:BoundField DataField="Contact" HeaderText="Contact" SortExpression="Contact" />
                            <asp:TemplateField HeaderText="Department" SortExpression="DEPT_Code" >
                                <ItemTemplate>
                                    <asp:Label ID="Label1" runat="server" Text='<%#Eval("DEPT_Code") %>'></asp:Label>
                                </ItemTemplate>
                                <EditItemTemplate>
                                    <asp:DropDownList ID="DropDownList2" runat="server" DataSourceID="SqlDataSource1"
                                    DataTextField="dep_Name" DataValueField="dep_Code" SelectedValue='<%# Bind("DEPT_Code") %>'>
                                    </asp:DropDownList>
                                </EditItemTemplate>
                                <InsertItemTemplate>
                                <asp:DropDownList ID="DropDownList3" runat="server" DataSourceID="SqlDataSource1"
                                DataTextField="dep_Name" DataValueField="dep_Code" SelectedValue='<%# Bind("DEPT_Code") %>'>
                                </asp:DropDownList>
                                </InsertItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Authentication" SortExpression="Authentication">
                            <ItemTemplate>
                                <asp:Label ID="Label2" runat="server" Text='<%#Eval("Authentication") %>'></asp:Label>
                            </ItemTemplate>
                            <EditItemTemplate>
                                <asp:DropDownList ID="DropDownList4" runat="server" SelectedValue='<%# Bind("Authentication") %>'>
                                <asp:ListItem Text="Admin_User" Value="1" />
                                <asp:ListItem Text="Super_User" Value="2" />
                                <asp:ListItem Text="Normal_User" Value="3" />
                                </asp:DropDownList>
                            </EditItemTemplate>
                            <InsertItemTemplate>
                            <asp:DropDownList ID="DropDownList5" runat="server" SelectedValue='<%# Bind("Authentication") %>'>
                                <asp:ListItem Text="Admin_User" Value="1" />
                                <asp:ListItem Text="Super_User" Value="2" />
                                <asp:ListItem Text="Normal_User" Value="3" />
                                </asp:DropDownList>
                            </InsertItemTemplate>
                            </asp:TemplateField>
                            <asp:CommandField ShowInsertButton="True" />
                            <asp:CommandField ShowEditButton="True" />
                        </Fields>
                    </asp:DetailsView>
                </td>
            </tr>
        </table>
      
       <asp:Label ID="ErrorMessageLabel" EnableViewState="false" runat="server" />
    </form>
</body>
</html>
  

View 4 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved