Database connections sometimes go wrong. There are problems with conn.open connstr, and problems with calling rs(user.id) in connection queries. Recently, I encountered a problem when building a customer management system for a customer:
The situation is as follows when using the following connection string:
connstr=DBQ=+server.mappath(db/#kehumsg.mdb)+;DefaultDir=;DRIVER={Microsoft Access Driver (*.mdb)};
set conn=server.createobject(ADODB.CONNECTION)
conn.open connstr
There is a join query,
The id of the second table to be called is used in
Normally, rs(b.id) can be adjusted like this, but it is displayed that the item is not found in the collection corresponding to the required name or ordinal number.
I couldn't find the answer after posting on csdn.
Finally, I used rs(id) to solve the problem. I thought, this call should be to adjust the id of the first table.
But it adjusts the second meter, but what I want is the second meter.
After some research, it turns out that this is really the case. It adjusts the ID of the latter table. It feels pretty good. I can research something by myself, haha~~
But when I was about to get off work, the customer said there was a problem and nothing could be accessed.
The error occurred in conn.open connstr of the above connection.
How could something go wrong here? I searched online and said that this happened, so I changed it according to what he said.
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
I didn’t think much about it, I probably gave it a try,
But the good times did not last long, and today the customer raised another problem.
After taking a look at it, I was convinced. Another error occurred in the joint query.
How could this happen? After some research with the manager, I finally discovered the problem:
At this time, you can call rs(b.id) in the id of the second table and you must call it in this way.
It cannot be like the first join character,
I think it should be a problem with the database engine. I don’t know what everyone thinks.
Here I recommend the second type of connection to everyone,
///////////////////////////////////////////////////// ////////// ///////////////////////////////////////////////////// ///////////
Another problem was discovered, and the solution is: add users to modify the permissions of windows/temp.