Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
[Sybase][ODBC Driver]Integrity constraint violation: no primary key value for foreign key 'MemberCode' in table 'PersonMember'
/admin/Member_New-Sybase.asp, line 39
What i am doing is first i have added a record to my persons table the next step is i need to add this person id to the PersonMember table with a new MemberCode and then finally add more information to a membership table. Code:
I'm trying to insert into a table with foreign keys. The statement works in query analyzer but not when I do it in asp to insert the data from a form. Code:
creating a script that will create a primary key base on the date today and a number ( ex. 1124204-1, 112404-2) with the last number increasing by one. the script should automatically increase the number if the key has already been used.
I have a table in MS SQL Server 2000 that has 4 fields, one of which is a primary key. How can I insert a new record and have SQL Server automatically handle the primary key field? I've tried the following SQL code:
Code: INSERT INTO orders(TransCode, TransTime, TransAmount) VALUES ('stuff', 'stuff', 'stuff') but it fails because the primary key is left NULL. I'm sure there is something really easy that I'm missing here.
I have an ASP page. In there, I retirieve some data (Korean characters for testing purpose) from the database and I tried to display it. If I set the session.codepage = 949, the foreign characters dodn't display correctly. If I set session.codepage = 1252, which is English (US), the foreign characters display fine in a combo box.
In SQL Server 2000, I have for examples 3 tables, sales, stock and purchase. both sales and purchase has stock# as foreign key.
When record is deleted from a stock table, first I want to make sure this stock doesnot exists in Sale, Purchase or anyother table in may have in future.
I would like to know what kind of constraints or restriction I can add on the database side and also how to catch the error from the ASP code.
Is there an easy way to change Currency formatting from USD to EUR (use comma as decimals delimiter instead of period)? I'm using Windows 2000 Server/IIS 5.0 in English. I'm serving both USD and EUR dynamically from the same source codes. I'd like to change Currency formatting automatically when a person chooses EUR.
I was wondering if anyone could help me with the following problem. I have a page set up to display various foreign language characters using:
<%@ Language=VBScript CodePage=65001%> And Response.charset = "utf-8"
The web page displays everything fine. However when I stream the page to MS word using Response.ContentType="application/msword", the foreign language characters are replaced by garbage. Interestingly, when I cut and paste directly from the original web page to Word, the characters are displayed correctly.
I have a script that send emails using CDONTS. There are users that have keyboards that support Spanish characters. I am able to render the chars correctly in the body using HTML substitutions, however, the subject line comes out bad. Is there a good way to handle this situation?
Let's say that someone trying to insert a record in the primary key which already exist... it returns an error, and in fact that error:
Error Type: Microsoft JET Database Engine (0x80004005) The changes you requested to the table were not successful because they would create duplicate values in the index, primary key, or relationship. Change the data in the field or fields that contain duplicate data, remove the index, or redefine the index to permit duplicate entries and try again How can I replace that error with a friendly message such as "that record already exists"
how to display search results on my web site in an order that I specify. at the moment there ordered by the primary key which means there all over the place.I know what the code is but I'm not sure how to use it, can anyone give me a quick lesson, does the code need to be on the search page or the results page?
I am designing Admin pages for my web site.I am using HTML frames, VBscript, Javascript, ASP , Microsoft Access as database etc.
I want when any Administrator put focus on any perticular frame and press some shortcut keys (like CTRL+A) then in the same frame one link called 'Admin' should be visible and active which then drive Administrator in Admin area to make necessary changes.For the rest user this Admin section would not be visible at all.
I would like to implement user authentication and session management for my applications. I've been using solution 1 (below) for most of my applications in the past since the target audience is mostly intranet based.
Now that I'm creating a more global application, I want to use a method that does not require cookies, yet maintain a farily high level of security and fault tolerance.
Is there a better way to handle this problem? What method does the big Internet shopping companies use?
Scenario:
A user is authenticated and is given a session key. The session key is passed to the user in an HTML page and returned to the server using a query string. The user then copies the URL and gives it to his friend to see. Since the URL now contains the session key, how does the server distinguish between the authenticated user and his friend?
Solution 1:
Use an ASP session variable to store the session key between page requests. This solution requires that the client have session cookies enabled. If the session is not encrypted (i.e. SSL), the ASP session id is still passed via. clear text, and is vulnerable.
Solution 2:
Use a session key that identifies the location (IP address) of the user. If the submitted session key doesn't match the user's location, then the session key is invalid. The session key can be passed as part of the URL and does not require cookies. This method is vulnerable to IP spoofing, and breaks if the user is behind a NAT server, or web caching server that masks the true IP address.
Solution 3:
Have the session key returned to the server via an HTTP POST request. This method does not require cookies, but is clear text and vulnerable if the session is not encrypted. The session key is lost if the user navigates to a page manually issuing an HTTP GET request.
I want to do something that should be simple, it is in php, but i can't seem to find any array functions in asp to do this. I have an array with x number of items (the x may change, could be 10/50/etc.) that will start with 1 and end with x.
For example (excuse my poor syntax): myArray[0] = 1 myArray[1] = 2 myArray[2] = 3 myArray[3] = 4 etc.
What I want is to call a function and randomize the array as a new array, so for example: randArray[0] = 3 randArray[1] = 1 randArray[2] = 4 randArray[3] = 2
Is it possible to get a key from the registry if a remote machine?We have three print servers (tin) serving an ERP application for different areas of the business.Currently someone has to logon and check to see if the servers are still running each morning.
However while they are running they increment a key in the registry once every second each time they poll. If I can get ASP to read this value, I should be able to setup a webpage to monitor the situation.I've found RegObj.dll on the Microsoft site, but this doesn't seem to work in ASP.
I have a field couponID as the primary key in my table - when writing the insert statement how do I get the autonumber value to be inserted? below is the code that I have, but it doesn't work
I wan to ask isit can generate a primary key before to insert a new record from asp to database (ms. access 2003). wat coding should i write for generate a primary key that unique? i cant find a solution to do that. my primary key will be sequences like :M0001, M0002...... follow
isit possible i genrate a primary at ASP pages before store/insert into the database?
basically i have given each customer, in tbl_user, that goes through the first page an "autonumber" (userID) and then each window has this same userID for each window that user selected. so i can then see the relationship between what user wants what windows.
My trouble is that im having difficulty creating a system where the correct userID is entered with the window Code:
I'm looking to display information pulled from a database based on information the user puts into a text box. The user will enter their sales rep number and I want to hit a table and return their name as soon as they tab off of the text box.
I'm using cookies to maintain a shopping cart. I can find plenty of tutorials and articles on deleting a cookie, but only deleteing a single key within a cookie is harder to find...
Surely there is a more efficient way to remove a cart item from my cookie than setting it equal to "", isn't there?
I mean, technically the cookie will still hold the text cartitem1 = "", right? Which takes up unnecessary space...
I have disabled the function keys (F1-F12). I would like each funtion key to submit a form. I'm not quite sure how to tell each function key to submit (post) for me.
I have a table in SQL 2000 with a composite Primary Key on coulumns Instrument_ID (int) and WeekOf (smalldatetime.) I am running asp on win 2003. Code:
Our graphic designer has just finished redeveloping our website. On the site, we use SSL to secure the area where a user enters their personal information to order items from us. (we do not do many transactions - maybe 1 per day...) We are a log home mfg company so they would only order plan books, maybe a video etc...
When the user clicks "Submit Order", we want to encrypt each data item (because of new legislation governing customer personal info etc...) and write a record to an access db. From here it will be imported into our Customer DB leads database...
I do not use ASP but program in VB 6 and Access 2000. ASP looks similiar in many ways...
Does someone have a good ASP script for encrypting data? And, if so, is it fairly strong encryption?
Also, is there any trick to writing an "insert" SQL script in ASP or is it exactly the same as I would do in VB or Access? Maybe someone has an "insert" script handy they could pass along including the command to actually execute it?
that's shortly the way i'm inserting new records. using mysql and asp functions.
The prob is that inserting only one record every time. if i got data for 3 records how can i make it at once to add 3 new records in some given order into the db
What is the best way to see if a record has inserted correctly into the datase in ASP? Also, how to tell the user what the error is. I am inserting like this with the ADO command object: Dim sInsert, objCmd set objCmd = Server.CreateObject("ADODB.Command") sInsert = "sp_ADS_Insert_Driver_General_Data " on error resume next With objCmd .ActiveConnection = oConnEnergy .CommandText = sInsert .CommandType = adCmdStoredProc .Execute , , adExecuteNoRecords