PDA

View Full Version : Does anyone speak ASP? Help!!



17-02-2002, 01:31 AM
Hi there,

I am attempting to solve the following problem...

I am making a website, in the process of doing so, I require to link a page to a database. The database is called 'Components', and has been appropriately set-up under ODBC. I have the following code in an attempt to access a specific part of the Column called 'ComponentName'. I wish to use the third row down, but on dozens of other places on the page I wish to use other rows...

Here's the code:

<%
Dim Connect, OnComponents, ThisComponent, ComponentID
Set Connect = Server.CreateObject('ADODB.Connection')
Connect.Open 'Components'
ThisComponent = CStr(ComponentID)
Set OnComponents = Connect.Execute( 'SELECT * FROM Components WHERE ComponentID=#' & ThisComponent & '#')
%>

That is the part that goes wrong, it displays the error:

Microsoft OLE DB Provider for ODBC Drivers error '80040e14'

[Microsoft][ODBC Microsoft Access Driver] Syntax error in date in query expression 'ComponentID=##'.

/5040/Ch01/Gaming.asp, line 8


Further down the page I call on these commands with the code:

<%=OnComponents('ComponentName')%>

If I make the first part so that it does reads 'ComponentID=3'' then it works, and I get component 3 where I want it, but when I want to call component 9 on the next line, I can't do it, because 'component=3'' has already been specified... Can you see the problem?

How do I get around this? What am I doing wrong?

Thanks for taking the time to decipher all that...

:)

Erin

17-02-2002, 12:32 PM
Erin,

I've forgotten most of the ASP I learnt 6 months ago but you could try posting it on an ASP discussion forum:

http://mail.2day.com/asp-discuss

(2day.com are a hosting company on Auckland's North Shore)

Heather

17-02-2002, 12:45 PM
Hi,

I tried posting on the asp-discuss forum, but it just threw me up error messages, but I have found another, although the conversation seems to be a long way above my level...

Still hanging out for help!

Thanks

:)

Erin