Created
September 25, 2012 04:18
-
-
Save otkrsk/3779957 to your computer and use it in GitHub Desktop.
Connecting to a database from classic ASP
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Dim conn | |
Dim objRS | |
Dim cmd | |
Set conn = Server.CreateObject("ADODB.Connection") | |
Set objRS = Server.CreateObject("ADODB.Recordset") | |
Set cmd = Server.CreateObject("ADODB.Command") | |
conn.Open "Provider=SQLOLEDB;Data Source=192.168.x.x;Initial Catalog=xxxxx;User Id=x;Password=xxxxxxxxxxxxxx" | |
Function InsertMO(ByVal StrDetail, ByVal TheTelco, ByVal ThePhone, ByVal TheSessionID, ByVal intkeywordid, ByVal intsessionid) | |
StrDetail = Replace(StrDetail,"|","-") | |
sqlInsert = "INSERT INTO InboxTbl (MobileNumber,KeywordId,Message,GUID,TelcoID,TransactionID) VALUES ('+6" & ThePhone & "'," & intkeywordid & ",'" & StrDetail & "','" & intsessionid & "'," & TheTelco & ",'" & TheSessionID & "')" | |
Set objRS = conn.Execute(sqlInsert) | |
End Function |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment