Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Invalid column name

Status
Not open for further replies.

GeorgeBC

Programmer
Nov 23, 2005
21
TR
Hi,

My database system updated from Access to MS SQL. But, i m receiving this error:

Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
[Microsoft][ODBC SQL Server Driver][SQL Server]Invalid column name 'false'.
/files/sql/program.asp, line 12

Code:
Dim rs
Set rs = CreateObject("ADODB.Recordset")
rSQL = "Select * from all_pages where active<>false and id = "& Request.QueryString("id")
Rs.Open rSQL, Con, 1, 3

This code was working fine MS Access DB system.
What can I do?

Thank you.
 
check the values of the active column in the all_pages table. Most likely they are 0 or 1 not true and False.

- Paul [batman]
- If at first you don't succeed, find out if the loser gets anything.
 
I assume that the active column has a data type of Bit. If this is true, then you should try...

Code:
rSQL = "Select * from all_pages where active <> [!]0[/!] and id = "& Request.QueryString("id")

You can determine the datatype by running this in query analyzer.

Code:
Select * 
from   Information_Schema.Columns 
Where  Table_Name = 'all_pages' 
       And Column_Name='active'

This will produce a recordset with one of the columns being data_type. If the data type is not Bit, then post back with that info.

-George

Strong and bitter words indicate a weak cause. - Fortune cookie wisdom
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top