detecting database type

Results 1 to 3 of 3

Thread: detecting database type

  1. #1
    Join Date
    Dec 1969

    Default detecting database type

    I want to be able to detect what database a ADO connection is connected to. Right now we use either Oracle or MS Access. I wrote this code that can tell the difference between Access and Oracle but I want to make it better. In the future we might use different databases. Does anyone have any ideas?<BR><BR>ConnA = Split(ObjConn, ";")<BR><BR>for i= 0 to UBound(ConnA)<BR>if Instr(ConnA(i), "DBQ=") then<BR> if Instr(ConnA(i), ".mdb") then<BR> Response.Write "Access" & "<BR>"<BR> Response.Write ConnA(i) & "<BR>"<BR> else<BR> Response.Write "Oracle" & "<BR>"<BR> Response.Write ConnA(i) & "<BR>" <BR> end if<BR>end if<BR>next<BR><BR>

  2. #2
    Join Date
    Dec 1969

    Default Uh...

    Why wouldn&#039;t you just search for a specific word like MSORA for the driver? Not sure of your exact connection string but surely there is something unique there. My syntax may not be 100% but wouldn&#039;t this be sufficient...<BR><BR>If instr(oConnA.connectionstring,"MSORA") &#060; 1 then<BR> &#039; is access<BR>else<BR> &#039; is oracle<BR>end if

  3. #3
    Join Date
    Dec 1969

    Default Use: Connection.Provider <eop>


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts