M
Mike Fellows
I have an SQL string that im trying to use to connect to an Access DB
im currently using the following string:
SQLStr = "SELECT
LEFT(LTRIM(RTRIM(Personal.postcode)),LEN(personal.postcode)-1) AS Expr1,
LiveTracker.ID, LiveTracker.MortgageAppSubmitted, Closed.ID FROM ((Personal
INNER JOIN PendingTracker ON Personal.ID = PendingTracker.ID) LEFT JOIN
LiveTracker ON Personal.ID = LiveTracker.ID) LEFT JOIN Closed ON personal.ID
= Closed.ID ORDER BY LEFT(LTRIM(RTRIM(Personal.postcode)),6);"
the above currently works perfectly and i have no problems but it doesnt do
exaclty as i want, what i would like it to do is this statement:
SQLStr = "SELECT Left(Personal.postcode,Len(personal.postcode)-2) AS Expr1,
LiveTracker.ID, LiveTracker.MortgageAppSubmitted, Closed.ID FROM ((Personal
INNER JOIN PendingTracker ON Personal.ID = PendingTracker.ID) LEFT JOIN
LiveTracker ON Personal.ID = LiveTracker.ID) LEFT JOIN Closed ON Personal.ID
= Closed.ID ORDER BY personal.postcode;"
the only difference between the two SQL statements is that the second
statement takes 2 charachetrs from the end of postcode whereas the first
statment only removes one!
when i try to run the second statement I get the following error:
An unhandled exception of type 'System.InvalidOperationException' occurred
in system.data.dll
Additional information: The provider could not determine the String value.
For example, the row was just created, the default for the String column was
not available, and the consumer had not yet set a new String value.
any help with this would be greatly appreciated
Regards
Mike Fellows
im currently using the following string:
SQLStr = "SELECT
LEFT(LTRIM(RTRIM(Personal.postcode)),LEN(personal.postcode)-1) AS Expr1,
LiveTracker.ID, LiveTracker.MortgageAppSubmitted, Closed.ID FROM ((Personal
INNER JOIN PendingTracker ON Personal.ID = PendingTracker.ID) LEFT JOIN
LiveTracker ON Personal.ID = LiveTracker.ID) LEFT JOIN Closed ON personal.ID
= Closed.ID ORDER BY LEFT(LTRIM(RTRIM(Personal.postcode)),6);"
the above currently works perfectly and i have no problems but it doesnt do
exaclty as i want, what i would like it to do is this statement:
SQLStr = "SELECT Left(Personal.postcode,Len(personal.postcode)-2) AS Expr1,
LiveTracker.ID, LiveTracker.MortgageAppSubmitted, Closed.ID FROM ((Personal
INNER JOIN PendingTracker ON Personal.ID = PendingTracker.ID) LEFT JOIN
LiveTracker ON Personal.ID = LiveTracker.ID) LEFT JOIN Closed ON Personal.ID
= Closed.ID ORDER BY personal.postcode;"
the only difference between the two SQL statements is that the second
statement takes 2 charachetrs from the end of postcode whereas the first
statment only removes one!
when i try to run the second statement I get the following error:
An unhandled exception of type 'System.InvalidOperationException' occurred
in system.data.dll
Additional information: The provider could not determine the String value.
For example, the row was just created, the default for the String column was
not available, and the consumer had not yet set a new String value.
any help with this would be greatly appreciated
Regards
Mike Fellows