Solved

", ' used in ODBC

Posted on 1998-10-29
2
181 Views
Last Modified: 2013-12-25
I want to insert the value of a object(customer_no.Text) in order to replace the constant string 'abc' on the folowing code. When I type "customer_no.Text", the error prompts.
How to replace the constant?

Moreover, the datatype of the table field in database is X(8), the datatype of the compared value is string. Should I  change the datatype before comparsion? and How?


Thanks
Sub button_ok_Click()
   
    Application.Run "QueryGetData", "", _
        "SELECT customer.cust-num, customer.cust-seq FROM HFC.customer customer WHERE (customer.cust-num=" _
        , , , , , False
    Application.Run "QueryGetData", "", _
        "'ABC')" _
        , , , , , False
    Application.Run "QueryGetData", "DSN=styline;DB=HFC;OIDP=TCP;OIDS=symixoib;OIDH=rs6000;DBAM=Direct;DBPR=TCP;DBPA=/symdb/sl-db/live-db/;DBO=-RO;ASC=0;SR=1;GST=0;UID=;PWD=", _
        "", True, True, False, Range("Sheet1!$A$1"), True, False
End Sub
0
Comment
Question by:highfashion
2 Comments
 
LVL 3

Accepted Solution

by:
fguerreiro_inix earned 200 total points
ID: 1497273
>When I type "customer_no.Text", the error prompts.

Why don't you try:

Application.Run "QueryGetData", "","'" & customer_no.Text & "'"  

0
 

Author Comment

by:highfashion
ID: 1497274
Thanks
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now