nsForum logo

Welcome Guest ( Log In )

 
Reply to this topicStart new topic
> Msaccess Dsn Not Working, msaccess DSN not working
hugonr
post Sep 12 2014, 09:04 AM
Post #1





Group: Verified NS Member
Posts: 1
Joined: 12-September 14
Member No.: 23,230



I created the dsn for my msaccess database as explained on the site, but in my test stript with this DSN, I get a 500 error

I tried other script without the connection and is working ok

here is my connection string:

Dim Conn
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.open "granfesta", "", ""
Set RS = Conn.Execute ("Select * from SENHA Where LOGIN = 'testlogin' "_
& " and SENHA = 'testpassword'")
if not RS.EOF and not RS.BOF then
RESPONSE.WRITE "works"
end if
Conn.close

this returns:
Server Error
500 - Internal server error.
There is a problem with the resource you are looking for, and it cannot be displayed.
Go to the top of the page
 
+Quote Post
kyboy
post Oct 29 2014, 09:57 AM
Post #2





Group: Verified NS Member
Posts: 181
Joined: 31-August 08
From: ky
Member No.: 2,243



The only way I could get mine to work was to explicitly supply the complete path to my mdb
Something like this

CODE
Conn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & "E:/333/555/222222/me/8888/htdocs/granfest.mdb" & ";Persist Security Info=False"
Conn.Open


How do you find your path?
Here's an asp script:
CODE
<%
Response.Write "<table align=" & chr(34) & "center" & chr(34) & " cellspacing=" & chr(34) & "0" & chr(34) & " cellpadding=" & chr(34) & "2" & chr(34) & " style=" & chr(34) & "width:575px;border-style:solid;border-width:1px;border-color:#000000;" & chr(34) & ">"
For Each VarName in Request.ServerVariables

Response.Write "<tr class=" & chr(34) & "breg" & chr(34) & " style=" & chr(34) & "vertical-align:top;" & chr(34) & ">" & chr(13) & _
"<td style=" & chr(34) & "background-color:#c0c0c0;font-weight:bold;border-style:solid;border-width:1px;border-color:#808080;" & chr(34) & ">" & _
VarName & _
"</td>" & chr(13) & _
"<td style=" & chr(34) & "border-style:solid;border-width:1px;border-color:#808080;" & chr(34) & ">"
If Len(Trim(Request.ServerVariables(VarName))) = 0 Then
Response.Write " "
Else
Response.Write Request.ServerVariables(VarName)
End If

Response.Write "</td>" & _
"</tr>" & chr(13)
Next

Response.Write "</table>"
%>


BTW, I suggest you name this script something other than say SERVERVAR.ASP, something only you would know, since it will display sensitive data.
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic
Tags
No Tag inserted yet

1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

RSS Lo-Fi Version    Network Solutions © 2011 Time is now: 28th July 2017 - 09:35 AM
Domain Names | Web Hosting | Web Design | Shopping Cart Software | Online Marketing | SSL Certificates