Click to See Complete Forum and Search --> : Help tracking down where my database actually is...


xvszero
08-07-2007, 12:22 PM
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?

Chikara
08-07-2007, 04:03 PM
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.

xvszero
08-08-2007, 10:19 AM
<%@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.

Chikara
08-08-2007, 10:23 AM
have a look in the connDealers.asp file

xvszero
08-08-2007, 10:24 AM
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.

Chikara
08-08-2007, 10:35 AM
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.

xvszero
08-08-2007, 10:40 AM
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>

Chikara
08-08-2007, 10:50 AM
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.

russell
08-08-2007, 03:44 PM
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

xvszero
08-08-2007, 04:12 PM
Hmm yeah thanks, found all the databases.

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

Chikara
08-08-2007, 04:15 PM
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.