Where do I put in SQL statements like INSERT and others when doing databases
Printable View
Where do I put in SQL statements like INSERT and others when doing databases
Sever side...
<% %> (everything between them is server side.
<% Option Explicit
Dim Conn,Rs,SQL
Set Conn = Server.createobject("ADODB.Connection") 'creates connection.
Conn.open Connectionstring 'path to database.
SQL = "Insert into table (Field1,Field2) values ('" & Val1 & "','" & Val2 & "')"
Conn.execute SQL
or
SQL = "Select * from table"
Set Rs = Conn.execute(SQL)
%>
<html>
<% do while not rs.eof %>
<%=rs("field1")%>
<% rs.movenext
loop%>
</html>
There is alot of ways doing this.