123 Eng

Engineering the engineers™


Latest Jobs   Forum Map

 


Home

Source Codes

Engineering Colleges

BE Students

Training  Reports (updated)

Seminar Reports (updated

Placement Papers (updated)

Forums

   Computer Science / IT

   Electronics

   Electrical

   Mechanical

   Chemical

   Civil

   CAT / MBA

   GMAT / Foreign MBA

Latest Jobs

Engineering Jobs / Technical Jobs

Management Jobs

Sitemap

About-Us

Terms of use

Displaying  Source Code(s)  
 

 
SqlExec Statement

--------------------------------------------------------------------------------

Description : The SqlExec statement executes an sql statement that returns no records. This is primarily useful for CREATE, DROP, INSERT, UPDATE or DELETE sql statements. There are two required arguments: ConnString and SQL. ConnString must be set to a valid database connection string and SQL must be set to a valid SQL statement.

<%
Private Sub SqlExec(ByVal ConnString, ByVal SQL)
Dim objCn, bErr1, bErr2, strErrDesc
On Error Resume Next
Set objCn = Server.CreateObject("ADODB.Connection")
objCn.Open ConnString
If Err Then
bErr1 = True
Else
objCn.Execute SQL
If Err Then
bErr2 = True
strErrDesc = Err.description
End If
End If
objCn.Close
Set objCn = Nothing
On Error GoTo 0
If bErr1 Then
Err.Raise 5109, "SqlExec Statement", "Bad connection " & _
"string. Database cannot be accessed."
ElseIf bErr2 Then
Err.Raise 5109, "SqlExec Statement", strErrDesc
End If
End Sub
%>

 

Contribute content or training reports / feedback / Comments
job placement papers
All rights reserved copyright 123ENG