|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Free Web 2.0 Code Generator! Generate data entry and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!
|
|
#1
|
|||
|
|||
|
help ! ! ! sql problem ! ! !
<i><b>Originally posted by : kiran (kiran@pl.jaring.my)</b></i><br />What is wrong with the following code ?<br /><br /><br /><head><br /><title></title><br /><BR><br /></head><br /><body><br /><h1>Your Record has been recorded</h1><br /><br /><%<br />'Opens a connection object<br />Set conntemp=server.CreateObject("ADODB.connection")<br />mydsn="DSN=destdb;uid=;pwd="<br />conntemp.Open mydsn<br /> <br /> Usera=CStr(Request.QueryString("date2"))<br /> Userb=CStr(Request.QueryString("month2"))<br /> Userc=CStr(Request.QueryString("class2"))<br /> Userd=CStr(Request.QueryString("alpha"))<br /> Usere=CStr(Request.QueryString("num"))<br /> <br />'Records Users Information<br />sql = "INSERT INTO destination(date2, month2, class2, alpha, num) VALUES( '" & (Usera) & "', '" & (Userb) & "'," & (Userc) & ", " & (Userd) & ",'" & (Usere) & "')"<br />conntemp.Execute(sql)<br />conntemp.Close<br />Set conntemp = Nothing<br />%><br /><br /></body><br /></html><br />
|
|
#2
|
|||
|
|||
|
<i><b>Originally posted by : DE (de.trancao@lrgl.uqam.ca)</b></i><br />------------<br />kiran at 6/21/2000 4:18:29 AM<br /><br />What is wrong with the following code ?<br /><br /><br /><%<br />set conn = Server.CreateObject("ADODB.Connection")<br />conn.open strconn<br /><br />Set Rs = Server.CreateObject("ADODB.Recordset")<br />' read questions attachement<br />strsql = "SELECT Q.ID, Q.uniqueDescription, sum(QA.belief) as belief , sum(QA.disbelief) as disbelief FROM CPRQuestion as Q, CPRQuestionAttachment as QA WHERE QA.to = Q.ID AND QA.fromProblem = 1"<br />strsql = strsql + " GROUP BY Q.ID, Q.uniquedescription"<br />Response.Write strsql<br />rs.open strsql, conn, 2, 2<br />Response.Write "<table align = center>"<br />Response.Write "<TR><TD>ID</TD><TD align=center>unique description</TD><TD>belief</TD><TD>disbelief</TD></TR>"<br />While Not Rs.EOF<br /> Response.Write "<TR><TD>" & rs("ID") & "</TD>" <br /> Response.Write "<td>" & rs("uniquedescription") & "</TD>"<br /> Response.Write "<TD>" & rs("belief") & "</TD>"<br /> Response.Write "<TD>" & rs("disbelief") & "</TD></TR>" <br /> rs.MoveNext <br />wend<br />Response.Write "</table>" <br />rs.close<br />set rs=nothing<br />%><br /><br />when execute, I receive the error message:<br /><br /><br />Microsoft OLE DB Provider for ODBC Drivers error '80040e07' <br /><br />[Microsoft][ODBC Microsoft Access Driver] Internal OLE Automation error
|
![]() |
| Viewing: ASP Free Forums > Database > SQL Development > help ! ! ! sql problem ! ! ! |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
![]() |
|