Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
ASP .Net
ASP General
No data return from ASP but Access returns correctly.
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="Jon Turlington, post: 4380825"] When in access the SQL Statement works as expected; in ADO it does not. I have replaced the * with the % so I am sure that's not the problem. Anyone have any idea? <% Dim objConn, objRS, sCity,CONNECTIONSTRING,ReponseString CONNECTIONSTRING = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Documents and Settings\jturlington\Desktop\Demographics\App_Data\DemoGraphics.mdb;User Id=admin;Password=;" 'Capture the username that we need to lookup, making sure its prepared for 'our forthcoming SQL query sCity = Replace(Trim(Request.QueryString("city")),"'","") 'Fire up ADO - ask the database whether or not the user idexists Set objConn = Server.CreateObject("ADODB.Connection") objConn.Open CONNECTIONSTRING sSQL = "select ID,GeographicArea from Data where GeographicArea like '%uni%'" response.Write(sSQL & "<br />") Set objRS = objConn.Execute(sSQL) WHILE NOT objRS.EOF ReponseString = objRS("ID") & "=" & objRS("GeographicArea") & "," objRS.MoveNext WEND Response.Write(sCity & " ") If Len(ResponseString) > 1 Then Response.Write(Left(ResponseString, Len(ResponseString) - 1)) Else Response.Write("No Records") End If 'Clean up objRS.Close objConn.Close Set objRS = Nothing Set objConn = Nothing %> [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
ASP .Net
ASP General
No data return from ASP but Access returns correctly.
Top