www.webdeveloper.com
Results 1 to 11 of 11

Thread: Help tracking down where my database actually is...

  1. #1
    Join Date
    Jun 2007
    Posts
    400

    Help tracking down where my database actually is...

    So I have been given the task of figuring out a bunch of ASP pages that were coded (but not documented) by a previous employee we no longer have any connection with. I'm supposed to convert them to PHP but I honestly can't even figure out where the guy is pulling the data from, and no one else here knows (it is a small company and things aren't really always done correctly...)

    This short ASP code seems to be included in the pages (with a different string for each page...)

    <%
    ' FileName="Connection_odbc_conn_dsn.htm"
    ' Type="ADO"
    ' HTTP="true"
    ' Catalog=""
    ' Schema=""
    MM_connAAABKAccts_STRING = "dsn=dbIDXBankruptcies;"
    %>

    But I can't figure out what it means, or if it has anything to do with where the data is being drawn from. And I can't find any Connection_odbc_conn_dsn.htm anywhere on the server.

    Anyone have any ideas?

  2. #2
    Join Date
    Oct 2006
    Posts
    251
    Looks to me that that doesn't mean much. Can you show us where they connect to the db? Should have something like this when they connect.

    dim objSomething = Server.CreateObject("ADODB.Connection")
    objSomething.ActiveConnection = Application("Something here.")

    That ActiveConnection property is where they connect to the DB. Find that line of code and past it here if you are still stuck.

    Also, seach the global.asa file and any includes that are there.

  3. #3
    Join Date
    Jun 2007
    Posts
    400
    <%@LANGUAGE="VBSCRIPT"%>
    <!--#include file="../../../Connections/connDealers.asp" -->
    <%
    set rsDealers = Server.CreateObject("ADODB.Recordset")
    rsDealers.ActiveConnection = MM_connDealers_STRING
    rsDealers.Source = "SELECT MasterCode, SubDealer, Agency, LocAddress, ESTL FROM tblMaster ORDER BY SubDealer ASC"
    rsDealers.CursorType = 0
    rsDealers.CursorLocation = 2
    rsDealers.LockType = 3
    rsDealers.Open()
    rsDealers_numRows = 0
    %>

    That looks like the connection, and then...
    <%
    ' FileName="Connection_odbc_conn_dsn.htm"
    ' Type="ADO"
    ' HTTP="true"
    ' Catalog=""
    ' Schema=""
    MM_connDealers_STRING = "dsn=dbDealers;"
    %>

    That is the included conndealers.asp file...

    I'm pretty clueless what to do next.

  4. #4
    Join Date
    Oct 2006
    Posts
    251
    have a look in the connDealers.asp file

  5. #5
    Join Date
    Jun 2007
    Posts
    400
    That is what this is...

    <%
    ' FileName="Connection_odbc_conn_dsn.htm"
    ' Type="ADO"
    ' HTTP="true"
    ' Catalog=""
    ' Schema=""
    MM_connDealers_STRING = "dsn=dbDealers;"
    %>

    That is the whole file.

  6. #6
    Join Date
    Oct 2006
    Posts
    251
    whoops didn't read correctly

    Hmm. I'm certainly not an expert, but that doesn't look like a valid connection string to me.

    1.) Look in the global.asa file to see if there is anything else that can help you.

    2.) See if there are any database files in the folder where that connDealers.asp file was.

    Also, take a look at your IIS settings. I believe that you can define connection strings in IIS. That might be for just ASP.NET though.

    I'm assuming that you probably aren't using SQL, MySQL, or Oracle. I mean worst case option you can just run around to each box and see what is installed on it. If one of those programs isn't installed look for Access.

  7. #7
    Join Date
    Jun 2007
    Posts
    400
    As for the folder with conndealers.asp, it is just all similar connection asp pages for each respective page (which seems like a stupid way to program it, but apparently this guy was a complete amatuer...)

    I'm *pretty* sure this is supposed to connect to an Access database, but no one seems to know for sure.

    This is the global.asa...

    <SCRIPT LANGUAGE=VBScript RUNAT=Server>

    'You can add special event handlers in this file that will get run automatically when
    'special Active Server Pages events occur. To create these handlers, just create a
    'subroutine with a name from the list below that corresponds to the event you want to
    'use. For example, to create an event handler for Session_OnStart, you would put the
    'following code into this file (without the comments):

    'Sub Session_OnStart
    '**Put your code here **
    'End Sub

    'EventName Description
    'Session_OnStart Runs the first time a user runs any page in your application
    'Session_OnEnd Runs when a user's session times out or quits your application
    'Application_OnStart Runs once when the first page of your application is run for the first time by any user
    'Application_OnEnd Runs once when the web server shuts down

    </SCRIPT>

    <SCRIPT LANGUAGE=VBScript RUNAT=Server>
    Sub Application_OnStart
    '==Visual InterDev Generated - startspan==
    '--Project Data Connection
    Application("conIndex_ConnectionString") = "Provider=MSDASQL.1;Persist Security Info=False;Data Source=Index;"
    Application("conIndex_ConnectionTimeout") = 15
    Application("conIndex_CommandTimeout") = 30
    Application("conIndex_CursorLocation") = 3
    Application("conIndex_RuntimeUserName") = ""
    Application("conIndex_RuntimePassword") = ""
    '-- Project Data Environment
    'Set DE = Server.CreateObject("DERuntime.DERuntime")
    'Application("DE") = DE.Load(Server.MapPath("Global.ASA"), "_private/DataEnvironment/DataEnvironment.asa")
    '==Visual InterDev Generated - endspan==
    End Sub
    </SCRIPT>

  8. #8
    Join Date
    Oct 2006
    Posts
    251
    This will probably help you.


    http://www.carlprothman.net/Default.aspx?tabid=89#DSN

    It's likely that the connection string information is held here. Go to admin tools, then Data Sources(OBDC) or something like that.

    Let me know if it doesn't.
    Last edited by Chikara; 08-08-2007 at 09:53 AM.

  9. #9
    Join Date
    Feb 2003
    Posts
    2,745
    look at the ODBC data sources applet in the control panel om the web server. the DSN will be there. click configure to see the details

  10. #10
    Join Date
    Jun 2007
    Posts
    400
    Hmm yeah thanks, found all the databases.

    Still have no idea where that mystery htm page is though.

  11. #11
    Join Date
    Oct 2006
    Posts
    251
    Quote Originally Posted by xvszero
    Hmm yeah thanks, found all the databases.

    Still have no idea where that mystery htm page is though.
    Doesn't matter, it's been commented out. If it did exist it would be in the same directory. If it's really bothering ya, just search your webserver for that file.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles