db updating (not working, why?)

Results 1 to 3 of 3

Thread: db updating (not working, why?)

  1. #1
    ktee Guest

    Default db updating (not working, why?)

    Hi all, <BR><BR>I&#039;m not sure if it&#039;s appropriate for me to post this question here, but I really need your help so PLEASE!!!!<BR><BR>Here is my code: <BR>---------- <BR>Dim fullname, org, address, city, state, request_ID <BR>request_ID = 5 &#039;5 is the existing row that I want to update <BR><BR>fullname = Request.Form("fullname") <BR>org = Request.Form("org") <BR>address = Request.Form("address") <BR>city = Request.Form("city") <BR>state = Request.Form("state") <BR>zip = Request.Form("zip") <BR><BR>Set objCmd = server.CreateObject("ADODB.Command") <BR>With objCmd <BR>.ActiveConnection = conn <BR>.CommandText = "request_form" <BR>.CommandType = adCmdstoredProc <BR>.Parameters.Append .CreateParameter ("Enter_user_name",adChar,adParamInput,20, fullname) <BR>.Parameters.Append .CreateParameter ("Enter_user_company",adChar,adParamInput,40, org) <BR>.Parameters.Append .CreateParameter ("Enter_user_company",adChar,adParamInput,40, address) <BR>.Parameters.Append .CreateParameter ("Enter_user_city",adChar,adParamInput,20, city) <BR>.Parameters.Append .CreateParameter ("Enter_user_state",adChar,adParamInput,2, state) <BR>.Parameters.Append .CreateParameter ("Enter_user_zip",adChar,adParamInput,9, zip) <BR>.Execute <BR>End With <BR>------------ <BR><BR>It doesn&#039;t give me any error but it also doesn&#039;t work. <BR>I tested my SQL query (access db) and it works just fine there. <BR>Here is my query: <BR><BR>UPDATE request SET request.request_date = Now(), request.user_name = [Enter_user_name], request.user_company = [Enter_user_company], request.user_street = [Enter_user_street], request.user_city = [Enter_user_city], request.state_code = [Enter_user_state], request.user_zip_code = [Enter_user_zip] <BR>WHERE (((request.request_id)=[Enter_req_id])); <BR><BR><BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: db updating (not working, why?)

    Hi Ktee,<BR><BR>I&#039;m not sure exactly what you are trying to do here. The code example you gave is showing trying to execute a stored procedure, however you said you tested an update via Access and it worked. So where exactly is your stored procedure and what kind of DBMS is it? Did you test your stored procedure to see it was working correctly? What exactly is in your stored procedure?<BR><BR>I think you need to think about exactly what you are trying to do and you need to test the EXACT things your are trying to do on the database side first.<BR><BR>Pete

  3. #3
    Join Date
    Dec 1969

    Default RE: db updating (not working, why?)

    I use access sp&#039;s (sorry stored querys) a lot and they look quite like yours, but I always declare the paramters.<BR><BR>Try something like<BR>.Parameters.Append .CreateParameter ("@username",adVarChar,adParamInput,20, fullname)<BR>.Parameters.Append .CreateParameter ("@company",adVarChar,adParamInput,40, org) etc ...<BR><BR><BR>query<BR>PARAMETERS [@username] text (20),[@company] text(40), etc .. [@zip] text(9); &#060;--note ;<BR><BR>update REQUEST set user_name = [@username], company = [@company]<BR>etc...<BR><BR>

Posting Permissions

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