adding new record to SQL

Results 1 to 2 of 2

Thread: adding new record to SQL

  1. #1
    Join Date
    Dec 1969

    Default adding new record to SQL

    say i have these codes in my asp pages:<BR><BR>set custRS = Server.CreateObject("ADODB.Recordset")<BR> custRS.Open "customer",conn,adOpenStatic,adLockPessimistic <BR> custRS.AddNew<BR> custRS.Fields("FC_FName") = Request("FC_FName")<BR> custRS.Fields("SC_FName") = Request("SC_FName")<BR> custRS.update<BR> custRS.moveLast<BR> customer = custRS("custID")<BR><BR>Field "custID" is self populate when a new record is added in. Now, I should able to assign variable "customer" with the customer ID, right? In fact, I was able to get that ID in my Development sqlServer. But when I move the code to a production srever going agains a production SQLserver, I can&#039;s get the value of customer from custRS("custID"). The 2 SQL server havw the same db structure. Is there any reason why one sql server gives out the custID but not the other running from one set of code?? The record including the self populate field did get to generate but it just not returning to the asp code.. why?<BR><BR><BR>

  2. #2
    Join Date
    Dec 1969

    Default there's a better way

    see the article &#039;save yourself SQL hassles&#039; in the ASP section at<BR><BR><BR>j

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts