Thank You
And also,sorry for thanking you late,
BUT I am getting error in the insert statement, and i am not being able to
solve it.
2ndly in this form,later more questions will be added, so is there any
simple way to count the # of textareas and then use it in for loop.
After my long search on google I found one thing...there is a class define
Class UtilityObj
Private _name As String
Private _value As String
Public Sub New(ByVal Name As String,ByVal Value As int)
_name = Name
_value = Value
End Sub
Public Property Name() As String
Get
Return _name
End Get
Set(ByVal Value As String)
_name = Name
End Set
End Property
Public Property Value() As String
Get
Return (_value)
End Get
Set(ByVal Value As String)
_value = Value
End Set
End Property
End Class
then using this function the name and ID is being inserted in the database
Funtion LoopingControls(oControl As Control)
Dim frmCtrl As Control
oArrayList = New ArrayList
For each frmCtrl in oControl.Controls
If TypeOf frmCtrl Is TextArea Then
Call FunctionDB(db)
End If
If frmCtrl.HasControls Then
LoopingControls(frmCtrl)
End If
Next
End Function
This is the function which will do database connection.
Function FunctionDB(db)
Set db=Server.CreateObject ("ADODB.Connection")
db.Open "DSN=surveydsn;User ID=dbo_sage;Password=sage;"
SQL = "INSERT INTO survey ( i, res ) "
& " VALUES(" & i & ","
& "'" & Replace(res, "'", "''") & "')"
db.Execute SQL
db.Close
db.Execute(VarQuery)
End Function
Now the thing is I am messed up with this, I have all the logic to
perform,but not being able to assemble it.
Lastly somebody told me to use Microsoft Visual studio 6, well i am not
being able to open interdev as I dont have FrontPage 98 server extension and
also Its not available on net free to download,
Hope you will again help me.
Thank again for your support,it really helped me.
"Old Pedant" wrote:
Using the FORM you actually show there, you would just alter my code to
<%
Set conn = Server.CreateObject("ADODB.Connection")
conn.Open "...your connection string ..."
For answerNumber = 1 TO 4
answer = Request("Your Thoughts Q" & answerNumber)
If answer <"" Then
SQL = "INSERT INTO answers( answerNumber, answer ) " _
& " VALUES(" & answerNumber & "," _
& "'" & Replace(answer, "'", "''") & "')"
conn.Execute SQL
End If
Next
conn.Close
%>
You didn't bother to show us the schema of your DB table, so I just assumed
TABLE: answers
answerNumber int
answer text