|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Be the architects of evolution and help create the mobile internet future. It’s your move---enter to win here! |
|
#1
|
|||
|
|||
|
Hi,
I have asp code that is part of a wap site to display database information but I'm getting an error when trying to access asp page from the wml page. The asp page opens fine with an emulator but only if directly browsed to. It returns an error if linked to from another site. The following error is returned: Microsoft OLE DB Provider for ODBC Drivers error '80004005' [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified /wap/score/Soccer/laliga_scoreASP.asp, line 22 The asp page is below. It's possibly something small but its stopping most of my pages which are written in asp. Line 22 is the Database connection. I use IIS on my laptop to test the page but when it's online it doesn't work. Does something have to be changed in the code to make it work online? Desperately need to find a solution so if any one can help me out here I would be hugely grateful. Cheers, Clem. Code:
<% Response.ContentType = "text/vnd.wap.wml" %>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml">
<wml>
<%
Dim strDBConn
Dim CONN_DSN
Dim DataConn
Dim dbData
Dim sqlSTR
Dim i
'Will use i to make card# increment
i=1
'Database Connection
'DSN
CONN_DSN = "Switchboard" 'modify this with your DSN name
strDBConn = "DSN=" & CONN_DSN
'Open Database Connection
Set DataConn = Server.CreateObject("ADODB.Connection")
DataConn.Open strDBConn, CONN_USER, CONN_PASS 'This is line22
'Assemble SQL query for La Liga database
sqlSTR = "SELECT * FROM tblLaLiga"
'Execute SQL Query creating recordset dbData
set dbData = DataConn.Execute(sqlSTR)
IF NOT dbData.eof THEN'if recordset is not empty
Do while not dbData.eof 'Do until you get to the end of the recordset
%>
<card id='card<%=i%>' title='La Liga'>
<do type='options' label='Next'>
<go href='#card<%=i+1%>'/>
</do>
<do type='accept' label='Up'>
<go href='/score/soccer.wml'/>
</do>
<p><b>02 March 2004</b></p><br>
<%
'Write Results
Response.Write dbData("Home Team") & " " & dbData("ScoreH") & "<br>" 'Show home team name, score, then <br> to next line
Response.Write dbData("Away Team") & " " & dbData("ScoreA") & "<br><br>" 'same as above, but 2 returns
Response.Write dbData("Time") & "<br><br>" 'Show time, then 2 returns
%>
<a accesskey='1' href='#card<%=i+1%>' title='Next'>Next</a><br/>
<a accesskey='2' href='/score/soccer.wml' title='Up'>Back to Scores</a></p>
</card>
<%
'Increment i
i = i+1
'Move to the next record before we loop
dbData.movenext
loop
END IF
'Close Recordset and Dataconn
dbData.close
set dbData = nothing
DataConn.Close
set DataConn = nothing
%>
</wml>
|
|
#2
|
|||
|
|||
|
I am somewhat new to wml myself. Its pretty easy to develop stuff, but hard to fix problems.
You might want to check mimes I am currently having a similar problem. I use php mysql and wml. I have easily created a data access system, but it is so dang picky! it works great on most simulators, and most devices. But on one of my older nokia phones (6610) it only works sometimes. Its weird. I also had to add a .htaccess file in the wml content folder in order to run .php files with wml/xml in the code. Then specify wml headers with php. Im not sure if this helps, but I hope so. GL! |
|
#3
|
|||
|
|||
|
Your DSN hasn't been defined
You need to define your connection string listed as "Switchboard" needs to be defined on any server running the asp "application"
to do this : go to ControlPanel -> Administrative Tools -> Data sources (ODBC) Select add and go through the steps. If you don't want to change the code name it Switchboard and you should be set. This is an ASP bug not WML. Let me know if this doesn't fix it as there are quite a few ways to configure your DSN..... |
|
#4
|
|||
|
|||
|
Hey Lab45,
Thanks for the help. I have a DSN called Switchboard on my IIS already and the site works fine on an emulator when opened directly but when linked to, it doesnt work. It returns an 'invalid data' message. When I try loading the page on a real phone it displays a message 'response unknown'. I'm going to get in touch with my server people and see what they can tell me. Cheers, Clem. |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > WAP Programming > Can anyone figure this out? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|