@@Identity Not Returning Data??
I have some asp that should be inserting a shopper into my SQL Server DB. Code:
View RepliesI have some asp that should be inserting a shopper into my SQL Server DB. Code:
View RepliesI tried the following:
Set RS=CN.Execute("INSERT into tableX yada yadayada ; SELECT
SCOPE_IDENTITY()")
Using Profiler, I see the statement go through.
But ASP gives me an error saying RS is not an object.
"Operation is not allowed when the object is closed."
In these lines
if not RS.EOF then
theNewId=RS.Fields(0)
end if
If I run the same query in QueryAnalyzer, I do get a return value.
Am I missing something?
I have a table that has ticket number displays as a link.When I click on a ticket number it displays no data was return. (" it's not reading the ticket number I choose")Can someone look over my codes and tell me what should be doing! I am a the final part and I lost.
View Replies View RelatedI have written some ASP code that selects some records from a SQL database according to a criteria, if no information is found in the database then it sees there is an End Of File in the object record set and prints the line below:
<%if objRecordset.EOF then Response.Write("No information was found for the record you have entered") %>
My problem is that if no records are found it still tries to print the information that it is looking for and cannot find and thus throws an exception. The code for that is below:
<Table Border="1" BGCOLOR="white">
<% Response.Write "<TR><TD>The date for that record is " & objRecordset("DateTime") & "<br></TD></TR>" %>
I have a database which stores information,I have a page which has links to each of the rows in the database and to search by each row it has its own unique ID. The problem I am having is only one row keeps getting returned from the database.I have an access database and using ASP. I think the problem could be with the SQL statement.
SQL = "Select * FROM monitoring where monitoringID = & request('ID') &"
I have an employee phone book application that is 5 years old. Written in asp with vb script calling sp's. when someone queries the all employee page they get all employees. When they then query employees by location it will again return the all employees data.
I changed the RS names in the all employee page in hopes that would fix it. I added the no cache code on all my pages and this hasn't helped. This app is 5 years old and hasn't changed at all but this just started happening within the past 6 months. When the user clears all cache and tries again it will work. How do I fix this?
im trying to display a name from a table, by matching up where an assigned_to id = emp_id in another table. Code:
View Replies View RelatedWhat is a faster/better coding practice?
Method 1:
Code:
Sub myFunction(byRef x)
x = x + 1 ' do something with x
End Sub
x = 7
myFunction(x)
response.write x ' shows 8
Method 2:
Code:
Function myFunction(x)
myFunction = x + 1 ' do something with x
End Function
x = 7
response.write myFunction(x) ' shows 8
Also discuss considerations when there are more than one variables that need to be changed.
I know in SQL Server that you can increment a field by one with Identity, but have read where if 2 or more people submit information at the same time this number may be duplicated. Is there a way to keep from having an incremental number duplicated if 2 or more people submit information at the same time?
View Replies View Related' Insert a new record into the table
lsSQL = "INSERT INTO tMembers (MemberName) VALUES ('Manohar');" &_
"SELECT @@IDENTITY AS NewID;"
I want to collect one more value from the newly created recordset. It's a replication ID field. Can i add one more item to the values being collected or should i just use another recordset and retrieve data i'm after.
I m writing a very typical ASP script which insert a record into one table with an identity column and then get the id generated and insert into another table.
Table_1 columns:
id_1
name
Table_2 columns:
id_1
id_2
But in with the ASP script below, I can't get the id_1 back. Code:
i'm trying to retrieve the @@Identity ID in sql so i can insert it into my other tables. the following code works in access, but not sure how it would retrieve it in sql. Code:
View Replies View Relatedi have a webpage which has 3 forms and each of the form has a about 20 controls. now what i want is to have these controls displayed in a mixed manner on the screen. moreover the ACTION pages of all the three forms are different. so is there anyway in which we can specify that TO WHICH FORM do they belong
my page is something like this
FORM1 starts
TEXTBOX(of FORM1)
FORM2 starts
TEXTBOX(of FORM2)
BUTTON(of FORM1)
END OF FORM1
TEXTBOX(of FORM2)
END OF FORM2
I have made a asp page that accepts some data from user and stores it in MS Access database. Now I want to identify the user who filled the form and store this information in database. About the enviornment.
the server has Windows 2000 server installed. Clients have Windows XP. Server also has Exchange 2003 installed and every client has Outlook Express installed. Every user has to login to his account inorder to use a machine. A given user can login on any machine.
How can i find the identity of the user who submitted the form? Is it possible to find out the current logged in user given the IP address of the machine? If yes, how and will there be any chances of error due to delay in replication?
Is it possible to use <identity impersonate> in ASP?(not ASP.net)
View Replies View RelatedI have a web page that adds records to multiple tables. I want to be able to get the new identity of a new record that was just added to the table. If for some reason, it didn't add, I want an error message to show up.
Here's the code in stored procedure for getting the new product id after the record was added. Code:
Is there a way in ASP (3.0, not .NET) for me to determine who the current windows users is (i.e. the user who was authenticated and who is "running" this IIS session)?
View Replies View Relatedis there any way I retrieve record identity from data that i just insert in...
View Replies View RelatedAm having a bit of trouble with the @@identity field - I probably just have that friday feeling and am missing off something obvious, but the below code brings back am empty identity value ("sid" appears empty). I've definitely set up an identity field in the tblSurvey:
set rsAdd = Server.CreateObject("ADODB.Recordset")
rsAdd.open "tblSurvey", conn, 3 , 3
rsAdd.AddNew
rsAdd("title") = title
rsAdd("intro") = intro
rsAdd("enddate") = enddate
rsAdd.Update
Set rsIdentity = Conn.Execute("SELECT @@IDENTITY AS sid")
sid = rsIdentity("sid")
....any ideas would be greatly appreciated.
I am doing a webpage which allows different users from various departments to do a search/print information of people within their own department. I have a login page for user to key in the correct password and id before they enter the system. However, in order for the restriction to take place, I will have to ensure that the system recognises the person that is logged into the system.
View Replies View Relatedwe have just migrated to a new server both with database and web server-
migrating all web projects and all databases.then we decided to rename the
new server.we tried running all web projects on the new server but it doesnt
work causing error "configured identity incorrect, check username and
password" in a certain line in the code.
i have searched for possile solutions like synchronizing identity account in
the 3 locations where this account is stored but it seems it doesnt work.
Earlier i was able to fix scheduled jobs in the database not working caused
by renaming the new server which is also the name of the database server.But
problems in the web files itself (asp) are giving me headache particularly in
code lines with "createobject."
Whats seems to be the particular problem?Can anyone point me to the right
resources to fix this prob?
I am trying to retrieve a record identity from a SQL Server auto-incremented field on insert statement.
Here is the error I am getting can anyone please help me
Microsoft OLE DB Provider for ODBC Drivers error '80040e14'
[Microsoft][ODBC SQL Server Driver][SQL Server]Cannot insert explicit value for identity column in table 'cwm_Report_Request_Form' when IDENTITY_INSERT is set to OFF.
/cwm/Admin/reportrequest.asp, line 66
here is my code:
Can someone give me an example of how to use a
stored procedure that returns XML data?
I want to call the SP from a VBScript program,
and put the XML into a data island in the generated HTML.
I've created a DLL file that enables you to validate accounts and send emails through the MS Exchange server within the Intranet. This dll can be used from within VB, VBA, VBScript and also ASP VBScript. I'm using it in an ASP page that I've created. The DLL has a "SEND" function that will return a string value containing all the invalid accounts seperated by a semi-colon. A sample of the returning string value would look like, "InvalidAcct1;InvalidAcct2;InvalidAcct3". The DLL works like it is suppose to when used in an ASP, but it will not return the string value. I know the DLL works fine because it returns it when used in a regular VBScript or VB program.Is IIS preventing the string from being returned?
View Replies View RelatedI am using a windows 2000 server with IISLockdown and ISAPI_Rewrite installed on it. I have 2 websites A & B. ASP pages on A are working properly, but when placed one B they return 404 error. All other pages such as txt, html, asp.net work fine on B. Both websites have the same configuration, and use the same ISAPI filters.
A sample cade the is not working is, file name test.asp:
<%@ LANGUAGE="VBSCRIPT" %>
<% response.redirect("http://www.cnn.com")%>
Do you know what needs to be done to fix that?
There are two pages main.asp and phonebook.asp.In the main.asp, there is a textfield, where the phone number will be inserted into it. Next to the textfield, there is an icon that when clicked takes you to the phonebook.asp page.
In the phonebook.asp page, there is a list of the telephone numbers and next to them there is a radiobutton. When one of the radiobuttons is chosen (the telephone number is chosen), the number (value) needs to be inserted in the textfield (main.asp page).How may i do this processing? Preferably i need to use asp together with vbscript or even javascipt.
I am using a windows 2000 server with IISLockdown and ISAPI_Rewrite installed on it. I have 2 websites A & B. ASP pages on A are working properly, but when placed one B they return 404 error. All other pages such as txt, html, asp.net work fine on B. Both websites have the same configuration, and use the same ISAPI filters.
A sample code that is not working is, file name test.asp:
<%@ LANGUAGE="VBSCRIPT" %>
<% response.redirect("URL")%>
Do you know what needs to be done to fix that?
Can someone give me an example of how to use a stored procedure that returns XML data?
I want to call the SP from a VBScript program, and put the XML into a data island in the generated HTML.
I have a MS SQL 7.0 table with a large field (> 500 characters). My select statement embedded in my ASP file in an intranet web interface only returns 255 characters. If I run the select statement in Query Analyzer, I can easily change the "Maximum Characters per Column" setting to return the entire field, but that doesn't help me in my ASP web interface. How do I return the entire field through ASP?
View Replies View RelatedI have a form page a user needs to fill out. I want to be
able to send the user back to the form once it is
submitted and an error in processing occurs, for example
if they have an illigal charcter in the form somewhere.
The whole form wouldn't need to be retyped, just the
field in question.
How can I send the user back to the form they just
submitted to correct an entry?
I am passing a XML to SP, and SP in return send XML back. When I comment out sp_xml_preparedocument (XML reading block) in SP, ASP is taking returning XML as valid, but, if I uncomment input XML reading block, ASP is giving following error: Code:
View Replies View RelatedI have a seach function and I need to be able to only return records that begin with numbers.
SELECT * FROM [Tbl_Table] Where name LIKE '0-9%'
I've got a site with PayPal and Google Checkout payment options. The checkout page formats two HTML forms, containing bespoke cart code - one posts to PayPal, the other to Google Checkout.When an order is placed, it needs to be updated back on my site, so that the order is marked as 'paid' in the database. When this is done with PayPal, I just provide a hidden field in the form called 'invoice' containing my id number for that transaction. This is returned in my IPN, and I update the database accordingly. However, I can't find a similar field in Google. Their example code all seems to be in XML and is WAAAAAAAAY more complicated than I need it to be. I just need to send a value with my cart code to Google Checkout, and have that value returned after the transaction has completed.
I've set up Google Callback, and the page is being called and the order is being written to my google log txt file, I just need this to contain my order id number for the transaction so I can just add the logic to update the database based on this id number.