|
phaithow -> RE: ASP & Connection to MS SQL database (10/7/2004 4:10:58)
|
I'm also face this problem. Here is my HTML Code. Could you please advise me on the mistake point? <html> <head> <meta http-equiv="Content-Language" content="en-us"> <meta name="GENERATOR" content="Microsoft FrontPage 6.0"> <meta name="ProgId" content="FrontPage.Editor.Document"> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> <title>New Page 1</title> </head> <body> <% DIM conntemp, mySQL, myDSN 'myDSN = " DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & server.mappath(" fpdb/spooky_login2000.mdb" ) 'myDSN would be specific to your environment 'myDSN = "DRIVER={SQL Server}; Server=Webserver\sqlInstance; UID=sa; PWD=kui9213; Languages=us_english;Database=Dhnarath2" myDSN = "PROVIDER=SQLOLEDB;DATA SOURCE=192.168.123.111;UID=sa;PWD=kui9213;DATABASE=Dhnarath2" set conntemp= server.createobject("adodb.connection" ) conntemp.open myDSN FOR i = 1 to 11 IF Request("rate" & i) > "" THEN mySQL = " INSERT INTO PO (PO_ID, Product_ID, Quantity,Unit,SP,Invoice_Number) VALUES" mySQL = mySQL & " (" & Request("PO_ID") & ", '" & Request("Product" & i) & "','" & Request("Quantity" & i) & "','" & Request("Unit" & i) & "'," & Request("SP" & i) & ", " & Request("Invoice_Number" & i) " Response.write(mySQL) conntemp.execute(mySQL) END IF NEXT conntemp.close set conntemp=nothing %> </body> </html> [:D] <html>
<head>
<meta http-equiv="Content-Language" content="en-us">
<meta name="GENERATOR" content="Microsoft FrontPage 6.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>New Page 1</title>
</head>
<body>
<% DIM conntemp, mySQL, myDSN
'myDSN = " DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & server.mappath(" fpdb/spooky_login2000.mdb" )
'myDSN would be specific to your environment
'myDSN = "DRIVER={SQL Server}; Server=Webserver\sqlInstance; UID=sa; PWD=kui9213; Languages=us_english;Database=Dhnarath2"
myDSN = "PROVIDER=SQLOLEDB;DATA SOURCE=192.168.123.111;UID=sa;PWD=kui9213;DATABASE=Dhnarath2"
set conntemp= server.createobject("adodb.connection" )
conntemp.open myDSN
FOR i = 1 to 11
IF Request("rate" & i) > "" THEN
mySQL = " INSERT INTO PO (PO_ID, Product_ID, Quantity,Unit,SP,Invoice_Number) VALUES"
mySQL = mySQL & " (" & Request("PO_ID") & ", '" & Request("Product" & i) & "','" & Request("Quantity" & i) & "','" & Request("Unit" & i) & "'," & Request("SP" & i) & ", " & Request("Invoice_Number" & i) "
Response.write(mySQL)
conntemp.execute(mySQL)
END IF
NEXT
conntemp.close
set conntemp=nothing
%>
</body>
</html>
|
|
|
|