Need Solution For Retrieving Data From Linked Table

V

Voss Man

This is my first post - yahoo!!!!!!!

Here are the facts, and the order of development:

I created an ASP. This ASP obtains data from a table from a
Mircrosoft Access Database, and creates a record set. The data in the
record set is then displayed to the user. Here is the code in my asp
associated with the recordset:

<%
' Declare variables
Dim adoCon 'Holds the Database Connection Object
Dim rsSCM_CSA 'Holds the recordset for the records in the
database
Dim strSQL 'Holds the SQL query for the database
Dim strSearch ' The text being looked for
%>


<%
'Create an ADO connection odject
Set adoCon = Server.CreateObject("ADODB.Connection")

'Set an active connection to the Connection object using a DSN-less
connection
adoCon.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & "\\Rsev46-09\Share_04\Webpages\ENG
\D280\mydatabase.mdb"

'Obtain Filter for Query from form on webpage
strSearch = Request.QueryString("formsearchstring")

'Initialise the strSQL variable with an SQL statement to query the
database
strSQL = "SELECT Document_PIN, Document_Type, Document_Title FROM
Documents WHERE Document_Project = '" & strSearch & "'"

'Create an ADO recordset object
Set rsSCM_CSA = Server.CreateObject("ADODB.Recordset")

'Open the recordset with the SQL query
rsSCM_CSA.CursorLocation = 3
rsSCM_CSA.Open strSQL, adoCon, 0, 1
rsSCM_CSA.Sort = "Document_PIN"
%>

This all works just fine.

Now here is where the problem comes in. The database has been split.
With this, the tables in the database have changed to linked tables.
Now, the webpage does not open.

Has anybody had to deal with this problem before?
Anybody have a solution?

X X X X X X X X X X X X X X X X X X X X X X X X X

I hope it is leagal to ask two questions with one post. I'm using
Dreamweaver as my development environment for my ASP. Is there any
way to debug or set breakpoints, or display messages for me to know
how/when/where the server is processing my ASP?
 
B

Bob Barrows [MVP]

Voss said:
This is my first post - yahoo!!!!!!!

Here are the facts, and the order of development:

I created an ASP. This ASP obtains data from a table from a
Mircrosoft Access Database, and creates a record set. The data in the
record set is then displayed to the user. Here is the code in my asp
associated with the recordset:

<%
' Declare variables
Dim adoCon 'Holds the Database Connection Object
Dim rsSCM_CSA 'Holds the recordset for the records in the
database
Dim strSQL 'Holds the SQL query for the database
Dim strSearch ' The text being looked for
%>


<%
'Create an ADO connection odject
Set adoCon = Server.CreateObject("ADODB.Connection")

'Set an active connection to the Connection object using a DSN-less
connection
adoCon.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & "\\Rsev46-09\Share_04\Webpages\ENG
\D280\mydatabase.mdb"

'Obtain Filter for Query from form on webpage
strSearch = Request.QueryString("formsearchstring")

'Initialise the strSQL variable with an SQL statement to query the
database
strSQL = "SELECT Document_PIN, Document_Type, Document_Title FROM
Documents WHERE Document_Project = '" & strSearch & "'"

'Create an ADO recordset object
Set rsSCM_CSA = Server.CreateObject("ADODB.Recordset")

'Open the recordset with the SQL query
rsSCM_CSA.CursorLocation = 3
rsSCM_CSA.Open strSQL, adoCon, 0, 1
rsSCM_CSA.Sort = "Document_PIN"
%>

This all works just fine.

Now here is where the problem comes in. The database has been split.
With this, the tables in the database have changed to linked tables.
Now, the webpage does not open.


No error messages? No nothing? Does your code have an "on error resume next"
line you haven't shown us? If so, comment it out so you can see the error
message and let us know what it is.
Has anybody had to deal with this problem before?
Anybody have a solution?


That said, ADO via ASP traditionally has problems with Access linked tables
(cue for someone to pop in saying "what are you talking about? I've had it
running fine for ages!"). I have seen several instances in this newsgroup
over the years where the original posters could never get it working. You
should probably consider connecting the database that contains the actual
tables rather than the one with the linked tables.
X X X X X X X X X X X X X X X X X X X X X X X X X

I hope it is leagal to ask two questions with one post. I'm using

It's not really a good idea (no legality involved - there's no newsgroup
monitor enforcing rules) - one question per post is the norm: it helps
people decide which posts they want to answer. What would have been so hard
about making a second post for this question?

Dreamweaver as my development environment for my ASP. Is there any
way to debug or set breakpoints, or display messages for me to know
how/when/where the server is processing my ASP?

Outside of my stock "Dreamweaver sucks" reply, I have to say I don't know.
Doesn't Dreamweaver have any forums where you can ask this question?
I gave up trying to step through server-side code years ago. I once had it
working with Interdev, but then it stopped worrking and I could never get it
to work again. So, I have resorted to using "Response.Write" and
"Response.End" to debug with. You might look at this:
http://support.microsoft.com/kb/299986/EN-US/

Oh, and have I said that DW sucks? Oh, yes, I guess I have ... :)

One last thing:
Your use of dynamic sql is leaving you vulnerable to hackers using sql
injection:
http://mvp.unixwiz.net/techtips/sql-injection.html
http://www.sqlsecurity.com/DesktopDefault.aspx?tabid=23

A quick browse through this and the asp.db newsgroups should allow you to
find several people whose sites have been hacked by a new internet worm
going around that uses sql injection to deliver its payload. You should
really take this seriously.

See here for a better, more secure way to execute your queries by using
parameter markers:
http://groups-beta.google.com/group/microsoft.public.inetserver.asp.db/msg/72e36562fee7804e

Personally, I prefer using stored procedures, or saved parameter queries
as
they are known in Access:

Access:
http://www.google.com/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&[email protected]

http://groups.google.com/groups?hl=...=1&[email protected]
 
M

Mike Brind [MVP]

Voss Man said:
This is my first post - yahoo!!!!!!!

I hope it is leagal to ask two questions with one post. I'm using
Dreamweaver as my development environment for my ASP. Is there any
way to debug or set breakpoints, or display messages for me to know
how/when/where the server is processing my ASP?

No. DW doesn't. You can either Response.Write statements as Bob suggested,
or get hold of Visual Studio 2005 or 2008.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,065
Latest member
OrderGreenAcreCBD

Latest Threads

Top