Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

", ' used in ODBC

Posted on 1998-10-29
2
Medium Priority
?
230 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 600 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

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
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…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

660 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