f



Database SQL

Does one have to do something when there is an apostrophe in the SQL 
statement if it's always going to be a variable that's being used in the SQL 
statement here's and example of what I mean

Dim rs as RecordSet
Dim TempString as String

rs = new RecordSet
TempString = "Frank's house"

rs = db.SQLSelect("Select * from main where HOUSES = '" + TempString + "'")

Using RealDatabase and RealBasic 5.5.3

I know in earlier versions the apostrophe would have to be escaped but I was 
told that in 5.5.3 this is not the case and it can be run as is.

Thanks 


0
JM
10/20/2004 5:45:10 PM
comp.lang.basic.realbasic 2744 articles. 0 followers. spam127 (8) is leader. Post Follow

1 Replies
461 Views

Similar Articles

[PageSpeed] 9

In article <acCdnUsS0rq7OevcRVn-jw@rogers.com>, "JM" <no@Spam.tu> 
wrote:

> Does one have to do something when there is an apostrophe in the SQL 
> statement if it's always going to be a variable that's being used in the SQL 
> statement

Yes, since the apostrophe is the quotation character in SQL, you have to 
double it.

> here's and example of what I mean
> TempString = "Frank's house"
> 
> rs = db.SQLSelect("Select * from main where HOUSES = '" + TempString + "'")

Right, expand that out, what you are telling the databse engine is:

  Select * from main where HOUSES = 'Frank's house'

which obviously isn't going to make any sense to a computer.  Do a 
ReplaceAll( tempString, "'", "''" ) and you should be fine.

> I know in earlier versions the apostrophe would have to be escaped but I was 
> told that in 5.5.3 this is not the case and it can be run as is.

Nope, you were told something that's not true.

Best,
- Joe

,------------------------------------------------------------------.
|    Joseph J. Strout         Check out the Mac Web Directory:     |
|    joe@strout.net           http://www.macwebdir.com             |
`------------------------------------------------------------------'
0
Joe
10/20/2004 8:14:08 PM
Reply:

Similar Artilces:

How to import from external SQL database to local SQL database
Hello everyone. I have two machines that have SQL Express on them. I have developed a SQL database with two tables, and a lot of data, on my laptop. I want to copy that database and make it available to my local desktop machine. How can I export or save the database on the laptop and then import it so that I can use it on the desktop? ...

DataBase DataBase DataBase DataBase
DataBase DataBase DataBase DataBase Porfessional Programmable Database Ver. 2.0 2.1 Million Record Capacity. Search Rate: 2000/Records/Second. DataBase Type: Random Access. Can Create Unlimited Databases. Programmable fields for any Application. Build Time One Second, (Auto Creates DB). Setup Time: Instantly, Just Enter DB Name. Ultra Easy to Learn (Typically 30 Seconds) Ultra Cheap Price, Special $20, Paypal Accepted. Application Mailed Instantly (file Attached Email). Easy Paypal Online Ordering. See Site Below. http://www.vehiclerepair.org/dbPro/dbpro.html ...

DataBase DataBase DataBase DataBase
DataBase DataBase DataBase DataBase Porfessional Programmable Database Ver. 2.0 2.1 Million Record Capacity. Search Rate: 2000/Records/Second. DataBase Type: Random Access. Can Create Unlimited Databases. Programmable fields for any Application. Build Time One Second, (Auto Creates DB). Setup Time: Instantly, Just Enter DB Name. Ultra Easy to Learn (Typically 30 Seconds) Ultra Cheap Price, Special $20, Paypal Accepted. Application Mailed Instantly (file Attached Email). Easy Paypal Online Ordering. See Site Below. http://www.vehiclerepair.org/dbPro/dbpro.html Scott: #DataBase...

Tools to extract data from SQL database and convert it into XML & insert XML data into SQL databases
As the subject said I am searching for a tool to extract data from SQL databases (e.g. MySQL) and convert it to an XML document. And vice versa a tool which enables me to insert a given XML data document into a (My)SQL database? Harry "Harry Zoroc" <harryzz@vodafone.com> wrote in message news:ccuvrq$dk$06$1@news.t-online.com... > As the subject said I am searching for a tool to extract data from SQL databases (e.g. MySQL) > and convert it to an XML document. www.intsysr.com/odbc2xml.htm > And vice versa a tool which enables me to insert a given XML data documen...

connect a database at Sql server 2000 from Visual Basic 6.0
Hello, i'm a programmer of Visual Basic who has to connect a database of Sql server 2000 but i don't know how to do this. If someone can help me, i would be very glad. Thanks a lot. marialokiya wrote: > Hello, i'm a programmer of Visual Basic who has to connect a database > of Sql server 2000 but i don't know how to do this. If someone can help > me, i would be very glad. Thanks a lot. > This is a Java newsgroup. Why don't you try a VB group? -- TechBookReport Java book reviews http://www.techbookreport.com/JavaIndex.html On 26 Oct 2005 01:24:34 -0700, &q...

US-TX-Austin: SQL Database Dev., SQL,SQL Analyzer and Profiler; (45349957602)
US-TX-Austin: SQL Database Dev., SQL,SQL Analyzer and Profiler; (45349957602) ============================================================================= Position: SQL Database Dev. Reference: ZYD00030 Location: Austin TX Duration: Skills: 3+ years experience as a Database Developer with significant SQL 2000 experience Must have the ability to develop, debug, test and troubleshoot queries,macros, and modules Experience and understanding of database design Proficient with SQL Query Analyzer, ...

US-TX-Austin: SQL Database Dev., SQL,SQL Analyzer and Profiler; (45349932406)
US-TX-Austin: SQL Database Dev., SQL,SQL Analyzer and Profiler; (45349932406) ============================================================================= Position: SQL Database Dev. Reference: ZYD00030 Location: Austin TX Duration: Skills: 3+ years experience as a Database Developer with significant SQL 2000 experience Must have the ability to develop, debug, test and troubleshoot queries,macros, and modules Experience and understanding of database design Proficient with SQL Query Analyzer, ...

US-TX-Austin: SQL Database Dev., SQL,SQL Analyzer and Profiler; (45349657602)
US-TX-Austin: SQL Database Dev., SQL,SQL Analyzer and Profiler; (45349657602) ============================================================================= Position: SQL Database Dev. Reference: ZYD00030 Location: Austin TX Duration: Skills: 3+ years experience as a Database Developer with significant SQL 2000 experience Must have the ability to develop, debug, test and troubleshoot queries,macros, and modules Experience and understanding of database design Proficient with SQL Query Analyzer, ...

US-TX-Austin: SQL Database Dev., SQL,SQL Analyzer and Profiler; (45349914408)
US-TX-Austin: SQL Database Dev., SQL,SQL Analyzer and Profiler; (45349914408) ============================================================================= Position: SQL Database Dev. Reference: ZYD00030 Location: Austin TX Duration: Skills: 3+ years experience as a Database Developer with significant SQL 2000 experience Must have the ability to develop, debug, test and troubleshoot queries,macros, and modules Experience and understanding of database design Proficient with SQL Query Analyzer, ...

US-TX-Austin: SQL Database Dev., SQL,SQL Analyzer and Profiler; (45349957602)
US-TX-Austin: SQL Database Dev., SQL,SQL Analyzer and Profiler; (45349957602) ============================================================================= Position: SQL Database Dev. Reference: ZYD00030 Location: Austin TX Duration: Skills: 3+ years experience as a Database Developer with significant SQL 2000 experience Must have the ability to develop, debug, test and troubleshoot queries,macros, and modules Experience and understanding of database design Proficient with SQL Query Analyzer, ...

US-TX-Austin: SQL Database Dev., SQL,SQL Analyzer and Profiler; (45349657602)
US-TX-Austin: SQL Database Dev., SQL,SQL Analyzer and Profiler; (45349657602) ============================================================================= Position: SQL Database Dev. Reference: ZYD00030 Location: Austin TX Duration: Skills: 3+ years experience as a Database Developer with significant SQL 2000 experience Must have the ability to develop, debug, test and troubleshoot queries,macros, and modules Experience and understanding of database design Proficient with SQL Query Analyzer, ...

US-TX-Austin: SQL Database Dev., SQL,SQL Analyzer and Profiler; (45349914408)
US-TX-Austin: SQL Database Dev., SQL,SQL Analyzer and Profiler; (45349914408) ============================================================================= Position: SQL Database Dev. Reference: ZYD00030 Location: Austin TX Duration: Skills: 3+ years experience as a Database Developer with significant SQL 2000 experience Must have the ability to develop, debug, test and troubleshoot queries,macros, and modules Experience and understanding of database design Proficient with SQL Query Analyzer, SQL Profiler ...

US-TX-Austin: SQL Database Dev., SQL,SQL Analyzer and Profiler; (45349932406)
US-TX-Austin: SQL Database Dev., SQL,SQL Analyzer and Profiler; (45349932406) ============================================================================= Position: SQL Database Dev. Reference: ZYD00030 Location: Austin TX Duration: Skills: 3+ years experience as a Database Developer with significant SQL 2000 experience Must have the ability to develop, debug, test and troubleshoot queries,macros, and modules Experience and understanding of database design Proficient with SQL Query Analyzer, ...

US-TX-Austin: SQL Database Dev., SQL,SQL Analyzer and Profiler; (45349914408)
US-TX-Austin: SQL Database Dev., SQL,SQL Analyzer and Profiler; (45349914408) ============================================================================= Position: SQL Database Dev. Reference: ZYD00030 Location: Austin TX Duration: Skills: 3+ years experience as a Database Developer with significant SQL 2000 experience Must have the ability to develop, debug, test and troubleshoot queries,macros, and modules Experience and understanding of database design Proficient with SQL Query Analyzer, ...

Relating a FM database to an SQL database
Hi All.. We're running Filemaker 6 with an upgrade to 7 scheduled shortly. We have recently established a "Data Warehouse" for commonly used data that is now available in a SQL server database. In the past, we would import the data that is now available in the data warehouse, from flat files. I'd like to relate the FM database to a dataset in the data warehouse to eliminate the need to download the data. Is this possible? To date, I have successfully established an ODBC connection from my Filemaker database to a database on the SQL server and have run an SQL command whic...

Web resources about - Database SQL - comp.lang.basic.realbasic

Database - Wikipedia, the free encyclopedia
A database is an organized collection of data . The data are typically organized to model aspects of reality in a way that supports processes ...

Database - Wikipedia, the free encyclopedia
... requiring information. For example, modelling the availability of rooms in hotels in a way that supports finding a hotel with vacancies. Database ...

Social Side of Code, Database CI and REST API Testing in Methods & Tools Winter 2015 issue
... for software developers, testers and project managers – has published its Winter 2015 issue that discusses the social side of code, database ...

Enterprises want to run databases in containers
More than three out of four IT decision makers are interested in running stateful applications like databases within containers, according to ...

Huge database of 191 million U.S. voters found on the open Internet
... such bulk information online, a recent discovery seems to indicate. According to VentureBeat , a security researcher found the exposed database ...

Top US School District Switches to Rimini Street for Oracle Database and Oracle E-Business Suite Support ...
Douglas County School District using savings from Rimini Street independent support to develop district-wide data visualization capabilities ...

IDG Contributor Network: Shrinking an already ginormous SharePoint database transaction log
Last month, I wrote about how to avoid having ginormous transaction logs within SharePoint databases. But what if it’s too late, and your files ...

Massive Voter Database Left Open For Public Consumption
Gosh, we could have avoided all the angst about the Clinton/Sanders voter database breach if only we'd known about this major database , accessible ...

18 million targeted voter records exposed by database error
A second database containing voter records has been exposed due to a configuration error. While the first held records that some dismissed inconsequential ...

Former Ohio cop uses cop database to stalk victim
... stalked her like an average person would, but stalked her in the way that only a police officer could: he stalked her utilizing a police database ...

Resources last updated: 1/31/2016 1:12:38 PM