|
Subject:
|
how to make column of table 1 = to column of table
|
|
Posted By:
|
gilgalbiblewheel
|
Post Date:
|
10/11/2004 8:45:18 PM
|
I want MS Access 2000 database column of table 1 = column of table 2.
This is what I was doing:
<%
'Option Explicit
'Response.End
Response.Buffer=false
Dim letter
'SQL = "SELECT bible.book_spoke, biblewheel_url.letter FROM bible, biblewheel_url WHERE bible.book_spoke=biblewheel_url.book_spoke"
SQL = "SELECT * FROM biblewheel_url WHERE "
strConn = GetConnectionString()
SQL = SQL & "letter(biblewheel_url.book_spoke) = rs(bible.book_spoke)"
Set letter = Server.CreateObject("ADODB.Recordset")
letter.CursorLocation = adUseClient
letter.Open SQL, strConn, adOpenForwardOnly, adLockReadOnly
%>
<%=letter("url")%>
<%
letter.Close
set letter = Nothing
%>
and to pull url address of table 2 to which record it is =to
|
|
Reply By:
|
happygv
|
Reply Date:
|
10/11/2004 11:37:46 PM
|
quote: SQL = SQL & "letter(biblewheel_url.book_spoke) = rs(bible.book_spoke)"
Can you post on what comes in rs(bible.book_spoke)? Though you can modify that asSQL = SQL & "letter(biblewheel_url.book_spoke) = " & rs(bible.book_spoke) Not sure what datatype it is, so use single quotes around if required.
Cheers!
_________________________ - Vijay G Strive for Perfection
|
|
Reply By:
|
gilgalbiblewheel
|
Reply Date:
|
10/11/2004 11:49:12 PM
|
Yes. This is what I get:
Microsoft OLE DB Provider for ODBC Drivers</FONT> error '80040e14'
[Microsoft][ODBC Microsoft Access Driver] Undefined function 'letter' in expression. /wheelofgod/letters.asp, line 18
letters is an "include" asp file. The purpose of this is to match the column of table 1 with the column of table 2 because table 2 has url links for each record. Thus by clicking on the link I should get different url depending what the number is.
Example I have "book_spoke" from table 1 which has a value of '15'. It should match with the "book_spoke" from table 2 which has the same value. (which one has to be primary key?). So table 2 has a url for each "book_spoke" value.
RS is supposed to be the recordset for the first sql. Letter is supposed to be the recordset for the second. I don't know if it makes sense. The second sql is for the second table.
|
|
Reply By:
|
gilgalbiblewheel
|
Reply Date:
|
10/11/2004 11:53:30 PM
|
ok. I tried your line and it says:
Microsoft VBScript runtime error '800a01a8'
Object required: ''
/wheelofgod/letters.asp, line 14
|
|
Reply By:
|
happygv
|
Reply Date:
|
10/11/2004 11:57:54 PM
|
what is on line 14? did you declare RS?
_________________________ - Vijay G Strive for Perfection
|