Timothy Marks

Greenhorn
+ Follow
since Sep 08, 2003
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Timothy Marks

Solved it. Seems that in Access,

Is legal and returns the expected rows, but if you are accessing the data programmatically, you must

Just another useless inconsistency that makes everything Billy does so darned difficult
When you execute the sql statement
"insert into UserInfo (CITY) in 'C:\\User.mdb' select CITY from RateInfo"
you are creating a new row in your database with the column CITY filled out, but the name and address will get the values of null.
If you were to use
"update UserInfo set CITY = (select CITY from RateInfo) where Name = '" +
theNameInTheRowThatNeedsToBeUpdated + "';"
you would change the value in the CITY column of UserInfo to the first result returned by the select statement.
From your description, this looks like what you want to do. Have I understood your problem correctly?
I am having a problem with Access and seem to be able to make no progress. Maybe someone can help.
When I execute the following sql query in Access, it returns (in my DB) 3 rows:
Select Project.* from Customer INNER JOIN Project ON Customer.ID = Project.Cust_ID WHERE ((Cust.Name) Like "*Abc*");
When I try the same query with Java, I get an SQLException. I don't know what it would say in English, but something about 1 parameter expected but too few are given.
When I change the " to ', it executes without an exception, but returns 0 rows.
When I change Like to =, it works fine.
Does anyone have any idea what the problem could be?
[ September 08, 2003: Message edited by: Timothy Marks ]
Do you mean
sql = "Update table2 set city = '" + cityvariable + "' where name = '" +
namevariable + "';";
stmt.executeUpdate(sql);
?
Just need to read city name into a variable and make sure that the name in namevariable is unique, but the sql should work.