Solved

", ' used in ODBC

Posted on 1998-10-29
2
213 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
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…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

735 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