ASP database Connection rs ("User.ID") _ Application Techniques

Source: Internet
Author: User
Recently, a problem has been encountered in making a customer management system for customers:

The following connection string is used as follows

Connstr= "dbq=" +server.mappath ("db/#kehumsg. mdb") + ";D efaultdir=;D river={microsoft Access DRIVER (*.mdb)};"
Set Conn=server.createobject ("ADODB. CONNECTION ")
Conn.Open ConnStr

There is a join query,
The ID to call the second table is used in the
As normal, the RS ("b.ID") can be tuned but displayed in the collection that corresponds to the desired name or ordinal, and no items are found.
The post on the CSDN can not find the answer,
Finally use RS ("id") to solve the problem, thought, so call should be the first table to adjust the ID bar,
But it's tuned to the second table, but I want the second one,
Research, the original is really so, it is tuned to the ID of the latter table. Feel good, I can study some things, hehe ~ ~
But when the client said there was a problem, nothing could get in.
The place where it went wrong was the Conn.Open connstr of the joint above,
How can there be an error here, on the internet to say that there is such a situation, so as he said changed to

Dbpath=server.mappath ("db/#kehumsg. mdb")
Connstr= "Provider=Microsoft.Jet.OLEDB.4.0;Data source=" & DBPath
Set Conn=server.createobject ("Adodb.connection")
Conn.Open ConnStr

Didn't think much, probably tried it
But today, the client said the problem again.
I got a look, I took it, it was a joint query that went wrong,
How did this happen, and the manager studied the problem that finally found out:

It is also necessary to call RS ("b.ID") in the ID of the second table.
Not like the first join character,
I think it should be the database engine problem, I don't know what you think,
Here we recommend the second type of connection,

/////////////////////////////////////////////////////////////////////////////////////////////////////////////// //////////

Also found a problem, the solution: Windows/temp permissions users add to modify permissions.
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.