1
Answer

connetion string classic asp oracle database

shakila jannat

shakila jannat

10y
1.6k
1
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>

<body>
<%


 On Error Resume Next 
 

 'Constants
 adCmdUnknown = 0
 adCmdText = 1
 adCmdTable = 2
 adCmdText = 1
 adParamInput = 1
 adParamOutput = 2
 adInteger = 3
 adUseClient = 3
 adOpenStatic = 3

 Dim cnnOracle
 Dim cmdStoredProc
 Dim rsEmp

 'This code creates a connection object.
 'Set cnnOracle = Server.CreateObject("ADODB.Connection")
 'cnnOracle.CursorLocation = adUseClient

 'System DSN connection
 'strConn = "DSN=rebek; UID=UserID; PWD=Password"

 'DSN-less connection
 'strConn = "Provider=MSDAORA.1; DSN=rebek; UID=biotpl; PWD=biotpl"

 'test
 set conn = Server.CreateObject("ADODB.Connection")
 set cmd = Server.CreateObject("ADODB.Command")
 set rs = Server.CreateObject("ADODB.Recordset")
 conn.mode = 3
 conn.open sConnString
 set cmd.activeconnection = conn
 
 
 'OLE DB connection
 'strConn = "Provider=MSDAORA.1; Data Source=DatabaseAlias; User ID=UserID; Password=Password"

'Note:  The DatabaseAlias is the name that was created in SQL*Net Easy Configuration or in Net8.

 cnnOracle.Open strConn

 'This code creates a command object.
 Set cmdStoredProc = Server.CreateObject("ADODB.Command")
 Set cmdStoredProc.ActiveConnection = cnnOracle
 

 'Retrieve only one record
 'cmdStoredProc.CommandText = "{call PRC_CHECK_CUSTOMER_INFO1(?,{resultset 2, pMobileNo, pErrorMessage})}"
 cmdStoredProc.CommandText = "{PRC_CHECK_CUSTOMER_INFO1(?,?)}"
 
 
 cmdStoredProc.CommandType = adCmdStoredProc
 
 'cmdStoredProc.CommandType = adCmdText
 cmdStoredProc.Parameters.Append 
 'call cmdStoredProc.CreateParameter ("pMobileNo",adNumeric,adParamInput,10,"140")
 
 call cmdStoredProc.CreateParameter ("pMobileNo",adInteger,adParamInput)
 'Private mProcParamEng As ADODB.Parameter
    'Set mProcParamEng = cmdStoredProc.CreateParameter("pErrorMessage", adVarChar, adParamOutput, 10)
 
 call cmdStoredProc.CreateParameter ("eng", adInteger, adParamOutput) 
 cmdStoredProc.Parameters.Append 

 
' cmdStoredProc.Parameters.Append cmdStoredProc.CreateParameter("pErrorMessage",adNumeric,adParamOutput,10)

 
'Private mProcParamEng As ADODB.Parameter
'Set mProcParamEng = cmdStoredProc.CreateParameter("eng", adVarChar, adParamOutput, 255)
'cmdStoredProc.Parameters.Append mProcParamEng
'mProcParamEng.Value = 0
 cmdStoredProc.Execute 
 
 'MyEng = mProcParamEng.Value
 'MyEng = 1254
   If err.number <> 0 then 
   Response.Write("</br> error no : " & Hex(err.number)&" error decription : "&vbCrLf&err.Description ) 
  end if 
%>

<HTML>

<BODY>


</BODY>
</HTML>
error:error no : E7D error decription : The connection cannot be used to perform this operation. It is either closed or invalid in this context.
Answers (1)