HELP! (Full Version)

All Forums >> [Web Development] >> ASP and Database



Message


jlosquared -> HELP! (4/23/2008 13:14:34)

My husband designed our site. We have a database of Dealers. I took over the website stuff and thought I would be able to handle it. I use Dreamweaver on a Mac. When I try and go to our Dealer Locator and type in a zip code, it gives me this error:


Microsoft OLE DB Provider for ODBC Drivers error '80004005'

[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified

/asp/dealer_locator_generator.asp, line 45

What the heck does all that mean, as you can tell I am a rookie and know close to nil about code




rdouglass -> RE: HELP! (4/23/2008 14:15:33)

quote:

/asp/dealer_locator_generator.asp, line 45

Hi and Welcome to OutFront.

I suspect that line might look something like "rs.open myDSN" or something like that? Can you post the previous and next 10 lines or so of the code? That would probably help some.

Generally that message means it can't open the database 'cause it can't figure out how or where it is. The connection string itself usually looks something along the lines of this:

myDSN = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("/fpdb/myDatabase.mdb")

That look familiar? See anything like that in there? If so:

1. Make sure the name and path of the database is correct.
2. Make sure you have proper read/write priv's for that (usually done at the host)

That help any?




jlosquared -> RE: HELP! (4/23/2008 14:51:49)

do I look in the dlrloctr.asp or the generator?




Spooky -> RE: HELP! (4/23/2008 15:36:31)

Have a look in the page "dealer_locator_generator.asp" and if possible, post the first 45 lines of code from there




jlosquared -> RE: HELP! (4/23/2008 15:37:50)

there's this

<TD WIDTH="500" BGCOLOR="" COLSPAN="2" BACKGROUND="./prdtbl.jpg">
<TABLE width=500 height=175 background=./images/formbgs/formbg1.jpg border=0>
<FORM id=dealer_search_input ACTION="./dealer_search_results.asp" METHOD="post" NAME="DaForm" >
<TR>




jlosquared -> RE: HELP! (4/23/2008 15:39:13)

ok, in the generator there is :

<%
Function return_good_value(incoming_string)
Dim incoming_regex_violations, was_found_violation, incoming_regex_spchrs, was_found_spchrs, Match
Set incoming_string_violations = New RegExp : Set area_code = New RegExp : Set prefix_digits = New RegExp : Set full_phone_number = New RegExp

incoming_string=Replace(incoming_string, "(", "")
incoming_string=Replace(incoming_string, ")", "")

incoming_string_violations.Pattern = "([(]|[a-zA-Z]{1,}|[)])": incoming_string_violations.IgnoreCase = True
full_phone_number.Pattern = "(\d{3}[\-]\d{3}[\-]\d{4})": full_phone_number.IgnoreCase = True
area_code.Pattern = "\d{3,}" : area_code.IgnoreCase = True
prefix_digits.Pattern = "(\d{3}[\-]\d{3})" :prefix_digits.IgnoreCase = True

set full_phone_number_matches = full_phone_number.Execute(incoming_string)
set violation_matches = incoming_string_violations.Execute(incoming_string)
set area_code_matches = area_code.Execute(incoming_string)
set prefix_digits_matches = prefix_digits.Execute(incoming_string)

was_found_violation = incoming_string_violations.Test(incoming_string)

If not was_found_violation Then
If full_phone_number.Test(incoming_string) Then
For each Match in full_phone_number_matches
return_good_value = Match.Value
Next
ElseIf prefix_digits.Test(incoming_string) Then
For each Match in prefix_digits_matches
return_good_value = Match.Value
Next
ElseIf area_code.Test(incoming_string) Then
For each Match in area_code_matches
return_good_value = Match.Value
Next
End If
Else
return_good_value = "OOPS! INVALID DATA <BR>"
For each Match in violation_matches
return_good_value = return_good_value & Match.Value & "." & "<BR>" & vbCRLF
Next
End If
End Function

%>
<% Dim SqlJunk : Dim validity_check : Dim dbGlobalWeb : Dim strSearchString
Set dbGlobalWeb = Server.CreateObject("ADODB.Connection") : dbGlobalWeb.Open("database") : SqlJunk = "SELECT * FROM tbl_Dealers" : validity_check=0




rdouglass -> RE: HELP! (4/23/2008 17:18:20)

quote:

dbGlobalWeb.Open("database")


That doesn't look right to me. Are you installing this from scratch so that these are the default values? I'd personally usually use something more along the lines of:

myDSN ="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("/fpdb/myDatabase.mdb")
dbGlobalWeb.Open(myDSN)

But maybe your's might work with something like this:

dbGlobalWeb.Open("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("/fpdb/myDatabase.mdb"))

where this:

"/fpdb/myDatabase.mdb"

is the path and file of an Access DB.

That help any?




jlosquared -> RE: HELP! (4/23/2008 17:22:05)

let me show this to my hubby and see if it's something I can change - everytime I try and change something I end up messing it up!




jlosquared -> RE: HELP! (4/24/2008 12:13:32)

Thanks for the help - I am glad there is this site with people who actually respond! My husband fixed it - he said it was a permissions thing -
I am sure I will be posting more questions in the future! You giys/gals rock!




jlosquared -> RE: HELP! (4/24/2008 12:37:00)

I think you mean "my" hubby - [;)] Unfortunately, his work doesn't allow him anytime during the day on the web, otherwise it would be great!




Page: [1]

Valid CSS!




Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI
0.0625