pnj
September 17th, 2003, 06:47 PM
ok, I'm NOT a programmer and never will be. I have built a few different apps using both VB 6 and ASP but those were years ago and very simple.
Now I have been asked to build a somewhat simple project for work.......(great:rolleyes: )
I have an access DB called 'Checker' and in it I have two tables.
the tables are called 'check' and 'stream'
I have an asp page that is mostly HTML but I need to open the DB and first check to see if a row has been filled. if it has, grab that data and display it in the page. if not, use the html that is hard coded. simple enough. I will do something like this
<% if rs.userName<>"" then
response.write rs.userName
else
'html goes here....
but I don't really know how to get my data out of the DB. we have a programer here at work but he's gone today so I can't ask him. but this is what he said I should do yesterday..
dim UserCommand, rs, connectionstring
connectionstring = "DSN=checker"
set usercommand=server.CreateObject("adodb.command")
usercommand.ActiveConnection = connectionstring
usercommand.CommandText = "select * from stream"
usercommand.CommandType = adCmdText
rs = usercommand.Execute
when I try and do a response.write and write out one of the fields from the DB I get an error that says
Error Type:
ADODB.Fields (0x800A0CC1)
Item cannot be found in the collection corresponding to the requested name or ordinal.
I'm sure that is not enough information for anyone to help me but if you can tell me what else you need, I will get it for you.
Thanks
Now I have been asked to build a somewhat simple project for work.......(great:rolleyes: )
I have an access DB called 'Checker' and in it I have two tables.
the tables are called 'check' and 'stream'
I have an asp page that is mostly HTML but I need to open the DB and first check to see if a row has been filled. if it has, grab that data and display it in the page. if not, use the html that is hard coded. simple enough. I will do something like this
<% if rs.userName<>"" then
response.write rs.userName
else
'html goes here....
but I don't really know how to get my data out of the DB. we have a programer here at work but he's gone today so I can't ask him. but this is what he said I should do yesterday..
dim UserCommand, rs, connectionstring
connectionstring = "DSN=checker"
set usercommand=server.CreateObject("adodb.command")
usercommand.ActiveConnection = connectionstring
usercommand.CommandText = "select * from stream"
usercommand.CommandType = adCmdText
rs = usercommand.Execute
when I try and do a response.write and write out one of the fields from the DB I get an error that says
Error Type:
ADODB.Fields (0x800A0CC1)
Item cannot be found in the collection corresponding to the requested name or ordinal.
I'm sure that is not enough information for anyone to help me but if you can tell me what else you need, I will get it for you.
Thanks