Newbee need help.

Newbee need help.

am 03.10.2004 12:18:34 von rfk

I am new to ASP and i am having some dificulities here and there.
I can not get the following code to wor like i want it to. I do not get
any messages that says that is something wrong bot there is no data from
the DB(ACCESS) displayed in the selectbox.

Wold be very gratefull if someone could tell me why.


The Newbwee.


<%
dim dbconn, rsTeaterStk
set dbconn = Server.createobject("ADODB.Connection")
dbconn.connectionstring = _
"Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=C:\Inetpub\wwwroot\telia\telia.mdb"
dbconn.open
set rsTeaterStk = Server.createobject("ADODB.Recordset")

rsTeaterStk.open "SELECT teaterstykke.forestillingsnavn FROM
teaterstykke",dbconn


%>

Velg teaterstykket som du har lyst å se






Velg Teaterstykke

Re: Newbee need help.

am 03.10.2004 14:12:38 von reb01501

Erik .F wrote:
> I am new to ASP and i am having some dificulities here and there.
> I can not get the following code to wor like i want it to. I do not
> get any messages that says that is something wrong

No errors? Do you have "On Error Resume Next" anywhere in your page?

> bot there is no
> data from the DB(ACCESS) displayed in the selectbox.

Does the "Alle" option display?
>
> Wold be very gratefull if someone could tell me why.
>
>
> The Newbwee.
>
>
> <%
> dim dbconn, rsTeaterStk
> set dbconn = Server.createobject("ADODB.Connection")
> dbconn.connectionstring = _
> "Provider=Microsoft.Jet.OLEDB.4.0;Data
> Source=C:\Inetpub\wwwroot\telia\telia.mdb"
> dbconn.open
> set rsTeaterStk = Server.createobject("ADODB.Recordset")
>
> rsTeaterStk.open "SELECT teaterstykke.forestillingsnavn FROM
> teaterstykke",dbconn

If you run this query using the Access Query Builder, does it give you the
intended results?

>
>
> %>
>

Velg teaterstykket som du har lyst å se


>
>
>
>
>
Velg Teaterstykke
>





HTH,
Bob Barrows

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"

Re: Newbee need help.

am 03.10.2004 14:28:20 von rfk

Bob Barrows [MVP] wrote:

> Erik .F wrote:
>
>>I am new to ASP and i am having some dificulities here and there.
>>I can not get the following code to wor like i want it to. I do not
>>get any messages that says that is something wrong
>
>
> No errors? Do you have "On Error Resume Next" anywhere in your page?
>
>
>>bot there is no
>>data from the DB(ACCESS) displayed in the selectbox.
>
>
> Does the "Alle" option display?
>
>>Wold be very gratefull if someone could tell me why.
>>
>>
>>The Newbwee.
>>
>>
>><%
>>dim dbconn, rsTeaterStk
>>set dbconn = Server.createobject("ADODB.Connection")
>>dbconn.connectionstring = _
>>"Provider=Microsoft.Jet.OLEDB.4.0;Data
>>Source=C:\Inetpub\wwwroot\telia\telia.mdb"
>>dbconn.open
>>set rsTeaterStk = Server.createobject("ADODB.Recordset")
>>
>>rsTeaterStk.open "SELECT teaterstykke.forestillingsnavn FROM
>>teaterstykke",dbconn
>
>
> If you run this query using the Access Query Builder, does it give you the
> intended results?
>
>
>>
>>%>
>>

Velg teaterstykket som du har lyst å se


>>
>>
Velg Teaterstykke


>>
>>
>>
Velg Teaterstykke
>>
>
>
> >
>
>
> HTH,
> Bob Barrows
>
Thanks for your reply Bob.
I have now solved the problem. There was a rather silliy mistake made by
me(I am a newbee). Wrong referance to mdb file was the prob here. I have
two you see, one emty backup and one with data in.

Yor example is more advanced and better, and I will use your
modifications. Again thank you very much.

Erik

Re: Newbee need help.

am 04.10.2004 10:11:45 von Agoston Bejo

"Erik .F" wrote in message
news:_lQ7d.869$HA5.98135@juliett.dax.net...
> I am new to ASP and i am having some dificulities here and there.
> I can not get the following code to wor like i want it to. I do not get
> any messages that says that is something wrong bot there is no data from
> the DB(ACCESS) displayed in the selectbox.

It may be that you do get an error message, but it gets written into the
select box, which the browser considers as a syntax error and doesn't
displays it. Always try to view the page source (by 'view source' in the
browser), and go to the bottom. Especially when you get empty SELECT's and
the rest of the page after it doesn't get displayed.

>
> Wold be very gratefull if someone could tell me why.
>
>
> The Newbwee.
>
>
> <%
> dim dbconn, rsTeaterStk
> set dbconn = Server.createobject("ADODB.Connection")
> dbconn.connectionstring = _
> "Provider=Microsoft.Jet.OLEDB.4.0;Data
> Source=C:\Inetpub\wwwroot\telia\telia.mdb"
> dbconn.open
> set rsTeaterStk = Server.createobject("ADODB.Recordset")
>
> rsTeaterStk.open "SELECT teaterstykke.forestillingsnavn FROM
> teaterstykke",dbconn
>
>
> %>
>

Velg teaterstykket som du har lyst å se


>
>
Velg Teaterstykke
>
>

>
>
>
Velg Teaterstykke
>

Re: Newbee need help.

am 18.01.2005 08:49:48 von Bullschmidt

<<
I am new to ASP and i am having some dificulities here and there.
I can not get the following code to wor like i want it to. I do not get
any messages that says that is something wrong bot there is no data from
the DB(ACCESS) displayed in the selectbox.
>>

Perhaps add some code to actually go to the first record:

If rsTeaterStk.EOF Then
' Close rs.
rsTeaterStk.Close
Set rsTeaterStk = Nothing
Else
' Move to 1st (and probably only) rec.
rsTeaterStk.MoveFirst
End If

Best regards,
J. Paul Schmidt, Freelance ASP Web Developer
http://www.Bullschmidt.com
ASP Design Tips, ASP Web Database Demo, Free ASP Bar Chart Tool...


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!