Forum Home
Press F1
 
Thread ID: 15768 2002-02-16 12:31:00 Does anyone speak ASP? Help!! Guest (0) Press F1
Post ID Timestamp Content User
35914 2002-02-16 12:31:00 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
Guest (0)
35915 2002-02-16 23:32:00 Erin,

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

mail.2day.com

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

Heather
Guest (0)
35916 2002-02-16 23:45:00 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
Guest (0)
1