Jump to content

ASP commands


Guest flame

Recommended Posts

hello ,i would really appreciate it if someone can help me with the meaning of this commands:1. <form name ="form1" action = "add to database.asp" method2. %@language= "VBscript"%<% option explicit %>3. set connection = server creat object <"ADODB.connection">set.recordset4. sconnstring="PROVIDER=microsoft.set.OLEDB.40" & "data source = " & server.mappath <"user.mdb">5. sconnstring = "PROVIDER = microsoft.set.OLEDB.40" & " data source =" & server .mappath <"user.mdb">set.recordset = nothing.6. execute the SQLconnection.execute<SQL>

Link to comment
Share on other sites

1. is a regular HTML form tag. Check the HTML reference to see what the different attributes mean.2. specifies to use VBScript as the language for the page. There are several languages you can write ASP pages with, VBScript is one of them. Option explicit means that you have to explicitly declare all variables before you use them. If you try to use a variable without declaring it first you'll get an error.3. creates an ADODB connection object.4. and 5. define the database connection string.6. executes a SQL statement on the connection object that was previously created.In VBScript you don't use <> to surround an argument though, you use (). e.g. Set connection = Server.CreateObject("ADODB.connection")

Link to comment
Share on other sites

Ok my question why did you ask this question, did you experience an error while trying to "add to database.asp"If thats the case then I have picked some of the reasons for your error.ok first instead of <> use (), secondly for your Provider use Jet not Set e.g. "Provider=Microsoft.Jet.OLEDB.4.0",thirdly your method should be method = "post"alright now answering your question1. This method is used to post data or get data from your application, in this case you need to post from your HTML form to your asp file.I guess thats enough from me, for your reference, see Alizhanes posting "Inserting a record to a database"the code is correct, should help.

hello ,i would really appreciate it if someone can help me with the meaning of this commands:1. <form name ="form1" action = "add to database.asp" method2. %@language= "VBscript"%<% option explicit %>3. set connection = server creat object <"ADODB.connection">set.recordset4. sconnstring="PROVIDER=microsoft.set.OLEDB.40" & "data source = " & server.mappath <"user.mdb">5. sconnstring = "PROVIDER = microsoft.set.OLEDB.40" & " data source =" & server .mappath <"user.mdb">set.recordset = nothing.6. execute the SQLconnection.execute<SQL>
Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...