IIS - Simple ASP DB problem.

Asked By Des
17-Jan-08 09:01 PM
I am trying to connect to a MySQL database on a windows server using
ASP / ADODB

I keep getting unable to display page

http://www.desmond-otoole.co.uk/index.asp

Any sugestions?
SQL Server
(1)
MySQL
(1)
ASP.NET
(1)
ADODB
(1)
Response.Write
(1)
Database
(1)
MachineName
(1)
ADdot
(1)
  Bob Barrows [MVP] replied...
15-Jan-08 10:27 AM
Not without seeing the code used to connect, as well as the acutal error
message ... do you have "friendly errors" shut off so you you can see
the actual errors in your browser?
http://www.aspfaq.com/show.asp?id=2109

--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
  Des replied...
17-Jan-08 09:01 PM
On 15 Jan, 15:27, "Bob Barrows [MVP]" <reb01...@NOyahoo.SPAMcom>

------------------
Hear is the entire code for the page. This is a MYSQL database


Set connection = Server.CreateObject("ADODB.Connection")
Set rsResult = Server.CreateObject("ADODB.Recordset")

sqlconn =
connection.Open sqlconn

sqlResults = "SELECT * FROM Members"

rsResult.Open  sqlResults, connection
rsResult.MoveFirst
sName = rsResult("f_name")

echo sName
%>
  Bob Barrows [MVP] replied...
15-Jan-08 01:06 PM
mondot;Pwd=s131679"
This is all the code I really needed to see. I don't use MySQL so I'm
not sure how the server is supposed to be referred to. Maybe you can try
an example at www.connectionstrings.com

Where is the error message you are getting? You could modify your code
to have vbscript handle the error and display the actual error message,
like this:

on error resume next
connection.Open sqlconn
if err <> 0 then
Response.Write err.message
else
'open the recordset and process it
end if

You are limiting our ability to help you by not telling us what error
message you are getting.

--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
  Jeff Dillon replied...
15-Jan-08 01:19 PM
Echo? Should be:

Response.Write sName

If that does not work, remove all other code, and have one line:


Response.Write "Hello World"

%>

and go from there

Jeff
  Des replied...
17-Jan-08 09:01 PM
r
109
id=3Ddesmon=ADdot;Pwd=3Ds131679"

-----------------
Error is
Microsoft OLE DB Provider for ODBC Drivers error '80004005'

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

/index.asp, line 9


Line 7: sqlconn =3D
=3Ddesmondot;Pwd=3Ds131679"
Line 8: conn.ConnectionString =3D sqlconn
Line 9: conn.open

Desmond
  Bob Barrows [MVP] replied...
15-Jan-08 01:43 PM
mondot;Pwd=s131679"
Ok, have you verified the syntax of your connection string a
www.connectionstrings.com?
The "mysql12.streamline.net" bit looks suspicious to me, but I'm used
the MS SQL Server, so that could be the correct way to refer to it. You
should verify with a mysql newsgroup.

Assuming the name you are using is correct, is that database server
accessible to the web server? And particularly, is it accessible to the
user account being used to run your code? If your website allows
anonymous access, then that user account is the IUSR_MachineName account
(replace "MachineName" with the name of the machine running the web
server ... )

--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
  Des replied...
17-Jan-08 09:01 PM
g
ror

=3D2109
a
;Uid=3Ddesmon=AD=ADdot;Pwd=3Ds131679"
=3Ddesmon=ADdot;Pwd=3Ds131679"

=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
Thanks Guys. I have changed the connection string to
Driver};Server=3Dmysql12.streamline.net;Database=3Ddesmondot;Uid=3Ddesmondot=
;Pwd=3Ds131679"
NOW this works

Cheers -> Desmond
  Ted Dawson replied...
15-Jan-08 05:11 PM
NOW would be a very good time to change your password.
  Evertjan. replied...
15-Jan-08 05:20 PM
Ted Dawson wrote on 15 jan 2008 in microsoft.public.inetserver.asp.general:


Now would be a better time to learn quoting, Ted.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
  Ted Dawson replied...
15-Jan-08 06:24 PM
Didn't want to repeat the PW again.
Create New Account
help
value name If Request.Form("ASPDBCatSearch") = "FirstName" Then ' HTML Input Text Box name is keyword SQL = SQL & " WHERE FirstName LIKE '%" & Request.Form("keyword") & "%' End If The rest values based on selection works Salary< / font> < / font> < / strong> <p> criteria< / font> < / font> < / strong> <p> - -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - - -- -- -- -- -- -- -- -- -- -- ASP Code Searchengineresults.asp Dim SQL Set aspdbweb = Server.CreateObject("ADODB.Connection") aspdbweb = "Provider = Microsoft.Jet.OLEDB.4.0; Data Source = " & Server.MapPath ("employees.mdb") & ";" SQL = "SELECT * FROM Employees" ' An Example on Salary Drop down Values to connect to the rest and Input txt Box) please here will be appreciated If Request.Form("ASPDBCatSearch") = "FirstName" Then SQL = SQL & " WHERE FirstName LIKE '%" & Request.Form("keyword") & "%' " End If If Request.Form("ASPDBCatSearch") = "LastName" Then
message: Microsoft VBScript compilation error '800a03ea' Syntax error / salespersonal / 1001 / contactos_1001-1form.asp, line 430 Response.Write(Session('autonumber')) - -- -- -- -- -- -- -- -- -- -- --^ The code is like follows now: onClick = "javascript:top.frames['I1'].location = 'contactos_1001form Site http: / / trevorl.mvps.org Trevor Your assumption about ASP is incorrect - it is processed server side (so by the time the browser sees the session variable it is already a side code is properly delimited (with appropriate single and / or double quotes where needed) The server side Function <% = ShowTextOnPic("Some text here")%> must evaluate correctly server side - as a valid client side attribute of the input tag Without seeing the ASP server side Function in your page ShowTextOnPic() - it is hard to debug your server side code - but it needs to write (server side) a valid form tag attribute (like say: title = "Some text here") Test your Function
find 10 times the last record of page 3). FrontPage Client Discussions Expression Web (1) Response.write (1) SqlStrCount (1) NoOfRecs (1) SqlStr (1) CStr (1) CInt (1) Conntemp.Close (1) Amateur look at your site while I'm at work - it is blocked by our proxy server. Did you use the Database Results Wizard to create the page? Can you post the SQL from the page here? - - ~ Kathleen Anderson Microsoft MVP - FrontPage Spider Web Woman Designs Expression Web redirect "contactos_web.asp?cmd = New" End if If Request.QueryString("dbcmd") = "delete" then Set conntemp = server.CreateObject("adodb.Connection") conntemp.open SqlStr = "DELETE FROM contactos_1001 WHERE autonumber = "+ Request.QueryString("db_autonumber") conntemp.Execute (SqlStr conntemp.Close SqlStr = "" End if If Request.QueryString("dbcmd") = "save" then Set conntemp = server.CreateObject("adodb.Connection") conntemp.open SqlStr = "UPDATE contactos_1001 SET " Sqlstr = SqlStr+"firstname = '"+FixDbFieldSave(Request.QueryString("db_firstname")) + "', " Sqlstr
is the snippet 'getting data connStr = "Provider = Microsoft.Jet.OLEDB.4.0; Data Source = " & _ Server.MapPath("test.mdb") Set conn = Server.CreateObject("ADODB.Connection") conn.Open connStr Set rs = Server.CreateObject("ADODB.Recordset") Set rs = conn.Execute ("exec q_anagrafica") rs.PageSize = number rs.AbsolutePage = pag While NOT rs.EOF And counter < number response.write ( rs("id") & " - " & rs("nome") ) response.write ( "<hr> " ) rs.Movenext counter = counter + 1 WEnd the error I'm getting is the
IIS Hi, I have these tables with binary data stored in tinyblobs and blobs in MySql. In my application I sometimes need to copy them to another table. Not all the the thing that causes the error. Please can you help. Thanx IIS ASP DB Discussions MySQL (1) ASP.NET (1) MyISAM (1) Response.Write (1) Cecexe.execute (1) Bm9ybWFucA (1) VBScript (1) Database (1) I've never worked with mysql, but this statement would make me absolutely reject it as a database-of-choice if you do a simple "INSERT INTO tablename (<column list> ) SELECT <column list> FROM othertable" in MySQL? - - Microsoft MVP - ASP / ASP.NET Please reply to the newsgroup. This email account is my