Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 Other SQL Server 2008 Topics
 Classic ASP Insert, Edit, Delete codes

Author  Topic 

ZKM128
Starting Member

3 Posts

Posted - 2012-05-14 : 01:13:34
Hello,
I need to know the correct ASP visual basic codes for inserting, updating and deleting records stored in the SQL Server 2008 Express using the Classic Active Server Page.

The SQL Server database file that I want to Insert/Edit/Delete is named 'StudentData.mdf' and attached to the SQL Server 2008 express on the same server.
This database files located at :
c:\Inetpub\wwwroot\db\StudentsWebsite\StudentData.mdf

I want to insert/edit/delete records to the table named 'Students'.
This simple 'Students' table in the StudentData.mdf has 4 fields, as shown below:
ID (int, Identity, Primary Key)
Name (nvarchar)
SchoolGrade (smallint)
DOB (date)

The classic ASP has variables stored in the VB variables named:
'varName', 'varSchoolGrade', 'varDOB'
and values in these variables should be added to the 'Students' table as a single record.

Please let me know the correct ASP VB codes for inserting the record.

Also, please show me the correct ASP VB codes for updating and deleting the student record in the 'Students' table WHERE ID = 3.

Many thanks,
   

- Advertisement -