37 users online (1 members and 36 guests)  


Page 2 of 2 First 1 2
  Results 16 to 25 of 25

Related

  1. HTML table to Database    Forum: HTML Forum
    Replies: 2
  2. Script database 29,000 Records for sale    Forum: Websites For Sale
    Replies: 1
  1. #16
    vinyl-junkie's Avatar
    Moderator

    Status
    Offline
    Join Date
    Sep 2005
    Posts
    721

    Re: inseting records to a database through html code...

    Both of us missed this one. You have a double slash in the path for your database.

    Code:
    C:\\Ammar.mdb
    Change that to a single slash.
    Music Around The World - Collecting tips, trade
    and want lists, album reviews, & more

  2. #17
    nawaray's Avatar
    New User

    Status
    Offline
    Join Date
    Apr 2007
    Posts
    14

    Re: inseting records to a database through html code...

    i have put one slash i still get the same error

  3. #18
    nawaray's Avatar
    New User

    Status
    Offline
    Join Date
    Apr 2007
    Posts
    14

    Re: inseting records to a database through html code...

    hi again,
    i have recognized where y error is , but now i'm getting this error msg
    Script error detected at line 21.
    Source line: conn.execute strsql
    Description: Syntax error in INSERT INTO statement.

    this is my code again:
    HTML Code:
    <%
    dim conn
     
    set conn=Server.CreateObject("ADODB.Connection")
    conn.open "PROVIDER=MICROSOFT.JET.OLEDB.4.0;DATA SOURCE=C:\\Ammar.mdb"  'this is without a password
    strsql = "INSERT INTO [Buy_info](name, address, tel , products_ des,cc_no) Values('" + Request("name") + "' , '" + Request("address") + "' , '" + Request(" tel") + "' , '" + Request("products_des ")+ "' , '" + Request("cc_no")+ "')"
    set rs=Server.CreateObject("ADODB.command")
    conn.execute strsql
     
     
    
    %>

  4. #19
    nawaray's Avatar
    New User

    Status
    Offline
    Join Date
    Apr 2007
    Posts
    14

    Re: inseting records to a database through html code...

    i need your help please?

  5. #20
    vinyl-junkie's Avatar
    Moderator

    Status
    Offline
    Join Date
    Sep 2005
    Posts
    721

    Re: inseting records to a database through html code...

    The path to your database is most likely incorrect. Fix this:

    Code:
    DATA SOURCE=C:\\Ammar.mdb
    Nothing else is going to work if that is incorrect.

    In a previous post, I said that you may have to remove the brackets from around the table name. Did you try doing that? Did you also add a display to see what your SQL statement looked like? Does it look correct? Did you try running your query from within MS Access as I suggested previously?

    There are also several differences in what I posted to what you have with respect to trying to execute your SQL statement. Please review those differences.

    Are you trying to execute a query based on some values in a query string? If so, your values need to be something like this example:

    Code:
    Request.QueryString("name")
    Music Around The World - Collecting tips, trade
    and want lists, album reviews, & more

  6. #21
    nawaray's Avatar
    New User

    Status
    Offline
    Join Date
    Apr 2007
    Posts
    14

    Re: inseting records to a database through html code...

    i have wrote this code and it worked :
    HTML Code:
    <%
    dim conn
    set conn=Server.CreateObject("ADODB.Connection")
    conn.open "PROVIDER=MICROSOFT.JET.OLEDB.4.0;DATA SOURCE=C:\\Ammar.mdb"  
    set rs=Server.CreateObject("ADODB.recordset")
    strsql = "insert into Buy_info Values('" + Request("name") + "' , '" + Request("address") + "' , '" + Request("tel") + "' , '" + Request("products")+ "' , '" + Request("ccno")+ "')"
    conn.execute(strsql)
    %>
    but now i'm getting this error :
    Script error detected at line 18.
    Source line: conn.execute(strsql)
    Description: Field 'Buy_info.products_des' cannot be a zero-length string.
    what does this mean?

    sorry 4 asking alot i'm really confuesd now

  7. #22
    vinyl-junkie's Avatar
    Moderator

    Status
    Offline
    Join Date
    Sep 2005
    Posts
    721

    Re: inseting records to a database through html code...

    Please review my prior posts. If you don't follow my suggestions, I cannot help you.
    Music Around The World - Collecting tips, trade
    and want lists, album reviews, & more

  8. #23
    nawaray's Avatar
    New User

    Status
    Offline
    Join Date
    Apr 2007
    Posts
    14

    Re: inseting records to a database through html code...

    hi,,,
    thankx vinyl-junkie alot for helping me... Everything worked fine now,,,

    i have one more thing,,,
    i have a page called products which has all the mobile products next to them a text box telling how many items are there for each product ( for example sony ericcsonw880i 5 pieces, ericsson t60 2 pieces,,( for example : if a user wants to buy sony ericssonw880i he will go to the buy page fill his name ,address ,etc and the product description( which is sony ericsson w880i) one he will click submit the records will be saved, i want when the user goes back to the product page he will see next to the sony ericssonw880i there is 4 items left because he has already bought one , how can i do this,,,

    my table for the products consists of:
    product_name, price, amount_left


    thankx

  9. #24
    vinyl-junkie's Avatar
    Moderator

    Status
    Offline
    Join Date
    Sep 2005
    Posts
    721

    Re: inseting records to a database through html code...

    You'll need to add a table which keeps track of the items they have in their shopping cart. It might look something like this:

    customer_id
    product_name

    You'll join the tables on product name. The logic for this can get rather complicated though. What you're talking about is a shopping cart system, and you'd be better off incorporating existing shopping cart software into your application rather than trying to build it yourself. Just my opinion.
    Music Around The World - Collecting tips, trade
    and want lists, album reviews, & more

  10. #25
    David Albert's Avatar
    New User

    Status
    Offline
    Join Date
    Oct 2007
    Posts
    9

    Re: inseting records to a database through html code...

    use the following in form tag
    form action="abc.aspx?parameter=1" method="post"
    and getting the parameter value "1" in asp page from there you can easily insert into database
    regards



Page 2 of 2 First 1 2

Tags for this Thread