Solved

", ' used in ODBC

Posted on 1998-10-29
2
225 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…
Suggested Courses
Course of the Month6 days, 22 hours left to enroll

623 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