Frequently Asked Questions


General Questions:

  1. Does J-ASP support JScript and JavaScript code in the server side ?
  2. Does J-ASP support Third-Party ActiveX/COM ?
  3. Why do I get the "The page cannot be found" error ?

ADODB Questions:

  1. Why do I get "4200 Not found the Driver" error ?
  2. How to connect a database with J-ASP ADO ?
  3. How to handle REF CURSOR output parameter with J-ASP?

List of FAQ

Does J-ASP support JScript and JavaScript code in the server side ?

No, J-ASP only supports VBScript server side code.

Does J-ASP support Third-Party ActiveX/COM ?

No, J-ASP can't support Third-Party ActiveX/COM. You need to migrate ActiveX/COM to JavaBean. J-ASP does support the JavaBean fine. We also provide ActiveX/COM to JavaBean migration services, please contact asp2jsp@netcoole.com if you need.

Why do I get the "The page cannot be found" error ?

Please make sure the path and file name are correct, the file name is case sensitive.

Why do I get "4200 Not found the Driver" error ?

You need set the JDBC Driver to CLASSPATH, for example:

  Dim DBConn
  Dim strCnxn
  strCnxn = "Driver=oracle.jdbc.OracleDriver;" & _
    "URL={jdbc:oracle:thin:@localhost:pan};" & _
    "UserID=SCOTT;Password=TIGER;"
  Set DBConn = Server.CreateObject("ADODB.Connection")
  DBConn.Open strCnxn

you need to add the Oracle jdbc driver ojdbc14.jar to CLASSPATH.

How to connect a database with J-ASP ADO ?

Please modify your ConnectionString as JDBC driver provided syntax:

"Driver=drivername;URL={url};UserID=userid;Password=password"

For example (Connect Oracle database):

  Dim DBConn
  Dim strCnxn
  strCnxn = "Driver=oracle.jdbc.OracleDriver;" & _
    "URL={jdbc:oracle:thin:@OracleSvr:ORCL};" & _
    "UserID=SCOTT;Password=TIGER;"
  Set DBConn = Server.CreateObject("ADODB.Connection")
  DBConn.Open strCnxn

   Note: please download Oracle jdbc driver from http://www.oracle.com

For example (MS-SQLServer with JTurbo jdbc driver):
  Dim DBConn
  Dim strCnxn
  strCnxn = "Driver=com.ashna.jturbo.driver.Driver;" & _
    "URL={jdbc:JTurbo://localhost:1433/pubs/sql70=true};" & _
    "UserID=sa;Password=secret;"
  Set DBConn = Server.CreateObject("ADODB.Connection")
  DBConn.Open strCnxn
   Note: please download JTurbo jdbc driver from http://www.jturbo.com

For example (MS-SQLServer with MS SqlServer JDBC Driver):
  Dim DBConn
  Dim strCnxn
  strCnxn = "Driver=com.microsoft.jdbc.sqlserver.SQLServerDriver;" & _
    "URL={jdbc:microsoft:sqlserver://localhost:1433;databasename=pubs};" & _
    "UserID=sa;Password=secret;"
  Set DBConn = Server.CreateObject("ADODB.Connection")
  DBConn.Open strCnxn
   Note: please download MS SQLServer JDBC driver driver from http://www.microsoft.com

For example (MySQL):
  Dim DBConn
  Dim strCnxn
  strCnxn = "Driver= org.gjt.mm.mysql.Driver;" & _
    "URL={ jdbc:mysql://mySQLSvr:3306/test};" & _
    "UserID=root;Password=secret;"
  Set DBConn = Server.CreateObject("ADODB.Connection")
  DBConn.Open strCnxn
   Note: please download MySQL jdbc driver from http://www.mysql.org

If you have created the JNDI Data Source Name in the webserver, you may change the connection string to the following format:

"DSN=JNDI-NAME;UID=UserName;PWD=Password"

For example:
We assume you have created JNDI name 'jdbc/TestDB' for your database, you may change the connection string to the following format to use the db connection pool.

  Dim DBConn
  Dim strCnxn
  strCnxn = "DSN=jdbc/TestDB;UID=SCOTT;PWD=tiger"
  Set DBConn = Server.CreateObject("ADODB.Connection")
  DBConn.Open strCnxn


How to handle REF CURSOR output parameter with J-ASP?

J-ASP supports REF CURSOR parameter, please refer to the following sample.

'----------------- SQL SCRIPT -----------------------
   CREATE OR REPLACE PACKAGE package_emp AS
      TYPE EmpCurTyp IS REF CURSOR;
      PROCEDURE get_emps (emp_cv OUT EmpCurTyp);
   END;
   /

   CREATE OR REPLACE PACKAGE BODY package_emp AS
      PROCEDURE get_emps (emp_cv OUT EmpCurTyp) AS
      BEGIN
         OPEN emp_cv FOR SELECT * FROM emp;
      END;
   END;
   /
'---------------- END SQL SCRIPT -------------------

   Set cmdStoredProc = Server.CreateObject ("ADODB.Command")
   Set cmdStoredProc.ActiveConnection = objConn
   cmdStoredProc.CommandText = "package_emp.get_emps"
   cmdStoredProc.CommandType = 4

   Set rs = cmdStoredProc.Execute

   Response.Write ("<table border=1>" & vbCrLf)
   Response.Write ("<tr>" & vbCrLf)

   for i = 0 to rs.fields.count-1
      Response.Write ("<th>" & rs(i).Name & "</th>" & vbCrLf)
   next

   Response.Write ("</tr>" & vbCrLf)

   While (Not rs.EOF)
      Response.Write ("<tr>" & vbCrLf)
      for i = 0 to rs.fields.count-1
         Response.Write ("<td>" & rs (i) & "</td>" & vbCrLf)
      next
      Response.Write ("</tr>" & vbCrLf)

      rs.MoveNext
   Wend

   Response.Write ("</table>" & vbCrLf)

   rs.Close
   objConn.Close