Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Connection String Woes

Status
Not open for further replies.

SkiCheif

Technical User
Sep 8, 2004
30
US
I am having trouble installing my MS Access database to the web. Unfortunately the web host wasn't able to answer my question. I attempted to look up the Tek-Tips FAQ on the subject, but the page won't load (just my luck!).

Here is what I am trying to do:

I have a database called Seed.mdb that I have uploaded to the web server. I contacted the support and they first told me that I need to set permissions, which I have and they confirmed.

Secondly they indicated that I need to change may path for the include file to there path [see below]

Here is the code of the include file:
Code:
<%
' FileName="E:\kunden\homepages\25\d113674742\db\Seed.mdb"
' Type="ADO" 
' DesigntimeType="ADO"
' HTTP="false"
' Catalog=""
' Schema=""
Dim MM_TestConnection_STRING
MM_TestConnection_STRING = "dsn=FileName;"
%>
Originally the MM_TestConnection_String said that dsn=FirstName I changed it to FileName because I though that that was my error?

Here is the code that calls TestConnection.asp
(the page where the code is)

Code:
<!--#include file="Connections/TestConnection.asp" -->

Here is a sample of the code requesting:

Code:
Set rsRecordsToChooseFrom = Server.CreateObject("ADODB.Recordset")
rsRecordsToChooseFrom.ActiveConnection = MM_TestConnection_STRING
rsRecordsToChooseFrom.Source = "SELECT AutoNumber, MatchDt, Weight_Class, Home_Wrestler_Name, Home_Wrestler_Score, Visitng_Wrestler_Name, Visiting_Wrestler_Score  FROM tbl_Match_Results  WHERE MatchDt = #" + Replace(rsRecordsToChooseFrom__MMColParam, "'", "''") + "# AND Home_Team = '" + Replace(rsRecordsToChooseFrom__MMColParam1, "'", "''") + "' AND Home_Team AND Visiting_Team = '" + Replace(rsRecordsToChooseFrom__MMColParam2, "'", "''") + "'"
rsRecordsToChooseFrom.CursorType = 0
rsRecordsToChooseFrom.CursorLocation = 2
rsRecordsToChooseFrom.LockType = 1
rsRecordsToChooseFrom.Open()

I have been able to build and run it on my local machines, but when I attempt to load the page online, I get an error with no number, just that the page didn't load.

There is a FAQ on the web hosting website that shows how to connect using every page. At this point, I would have to reload almost the entire site after changing the connection information. Is this what I have to do to make it work?

Thanks for your help! :)
Keith



 
FYI: I looked at the code that I pasted and realized that the majority of it was rem'd out. I suspect the helpful fella from the webhosting company though that he would be funny by changing the name and remming out the lines to see if I would catch it.

Hmmm

I fixed it, but that still doesn't allow it to connect. Perhaps he changed another spot in the wording?

Thanks again
 
Are you still using a DSN to connect, if so has this been setup on the webspace?
 
When I called to talk to them about it, they fed me the path and sent me on my way. I asked them the same question and they implied that the path was all that I needed.

I was sceptical, but no knowing much about the topic I asked a few more questions and the person sounded like they knew what they were taking about.

Is this something that you would normally have a console or app to set up?
 
seems your problem is in this block of code :

<%
' FileName="E:\kunden\homepages\25\d113674742\db\Seed.mdb"
' Type="ADO"
' DesigntimeType="ADO"
' HTTP="false"
' Catalog=""
' Schema=""
Dim MM_TestConnection_STRING
MM_TestConnection_STRING = "dsn=FileName;"
%>

if you're using a full blown windows ODBC system ( not file ) DSN you can reference it via dsn=filename ONLY if the DSN is aliased as "filename"...
if you're trying to use the value of FileName in the above code, the line is remmed and that would be a method of a DSN-Less connection and there's plenty of information in the FAQ's about data connections and connectivity.

also i see no location in the supplied code above where you create and or open a ADO or RDO connection object ... the line :
rsRecordsToChooseFrom.ActiveConnection = MM_TestConnection_STRING

should be referencing a connection object which would look something like this :

strDSN = "DSN=MyDSNthingey;"
Set Conn = Server.Createobject("ADODB.Connection")
Conn.Open strDSN

then ... in your code as above (changed)
rsRecordsToChooseFrom.ActiveConnection = Conn


hope the info helps

[thumbsup2]DreX
aKa - Robert
if all else fails, light it on fire and do the happy dance!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top