![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hello; Access 2000 sql server 2000; I have a sql server table linked into my access db. One of the fields is OLE dtype in Access-binary in sql server. I have built a passthrough query to view this data. Could someone assist me with the syntax for the CONVERT function? I tried: CONVERT(varchar(25), BITS, text). BITS is the field name. I get an error message stating that text is not a valid column name. I am using the help explanation of: CONVERT(data_type(length),data_to_be_converted,sty le) The style argument is a number that controls the format of data to be |
#3
| |||
| |||
|
|
Hello; Access 2000 sql server 2000; I have a sql server table linked into my access db. One of the fields is OLE dtype in Access-binary in sql server. I have built a passthrough query to view this data. Could someone assist me with the syntax for the CONVERT function? I tried: CONVERT(varchar(25), BITS, text). BITS is the field name. I get an error message stating that text is not a valid column name. I am using the help explanation of: CONVERT(data_type(length),data_to_be_converted,sty le) Oops - accidently hit Send somehow. |
#4
| |||
| |||
|
|
Tony_E wrote: Hello; Access 2000 sql server 2000; I have a sql server table linked into my access db. One of the fields is OLE dtype in Access-binary in sql server. I have built a passthrough query to view this data. Could someone assist me with the syntax for the CONVERT function? I tried: * CONVERT(varchar(25), *BITS, text). BITS is the field name. I get an error message stating that text is not a valid column name. I am using the help explanation of: * *CONVERT(data_type(length),data_to_be_converted,st yle) The style argument is a number that controls the format of data to be output. It is optional. For example, when converting a datetime to char, you can use the style argument to control how the resulting string is formatted: 0 or 100 is the default mon dd yyyy hh:miAM(or PM) 101 * * * * * * * * * * * * * * mm/dd/yyyy 1 * * * * * * * * * * * * * * * * mm/dd/yy 8 * * * * * * * * * * * * * * * *hh:mm:ss etc. For Try CONVERT(varchar(25), *BITS) |
#5
| |||
| |||
|
|
On Apr 7, 10:13 am, "Bob Barrows" <reb01... (AT) NOyahooSPAM (DOT) com> wrote: Tony_E wrote: Hello; Access 2000 sql server 2000; I have a sql server table linked into my access db. One of the fields is OLE dtype in Access-binary in sql server. I have built a passthrough query to view this data. Could someone assist me with the syntax for the CONVERT function? I tried: CONVERT(varchar(25), BITS, text). BITS is the field name. I get an error message stating that text is not a valid column name. I am using the help explanation of: Hello; Thanks for the quick response. I tried CONVERT(Varchar(25),BITS) I got the message: ODBC call failed Sql Server Driver explicit conversion from data type image to varchar not allowed. I bet the solution is something close to this though. |
#6
| |||
| |||
|
|
Tony_E wrote: On Apr 7, 10:13 am, "Bob Barrows" <reb01... (AT) NOyahooSPAM (DOT) com> wrote: Tony_E wrote: Hello; Access 2000 sql server 2000; I have a sql server table linked into my access db. One of the fields is OLE dtype in Access-binary in sql server. I have built a passthrough query to view this data. Could someone assist me with the syntax for the CONVERT function? I tried: CONVERT(varchar(25), BITS, text). BITS is the field name. I get an error message stating that text is not a valid column name. I am using the help explanation of: Hello; Thanks for the quick response. I tried CONVERT(Varchar(25),BITS) I got the message: ODBC call failed * * * * * * * * * * * * * * *Sql Server Driver explicit conversion from data type image to varchar * * * * * * * * * * * * * * *not allowed. I bet the solution is something close to this though. image datatype <> binary datatype. As the error says, direct conversions from image to varchar are not allowed. You need to first convert the image to binary, and then convert the result to varchar. You can nest the calls like this CONVERT(Varchar(25),CONVERT(varbinary(25),BITS)) You can also use CAST, if you want, instead of CONVERT since no style setting is possible or needed: CAST(CAST(BITS As varbinary(25)) AS varchar(25))- Hide quoted text - - Show quoted text - |
#7
| |||
| |||
|
|
That seems to work. I might have a different problem. I view the output when I run the query and all that displays in that binary field is the first character. All the records that were appended through an Access append query have the same symptom. Yet, other records, that were input via a window in our ERP application, display the full text value. Do you think that appending to a binary field (when the data being appended is only simple text) might not fully succeed? It just seems odd that only the first character would appear. If you have any theories I would be willing to read them. None. As I said before, I've never dealt with this datatype. Sorry. |
#8
| |||
| |||
|
|
Tony_E wrote: That seems to work. I might have a different problem. I view the output when I run the query and all that displays in that binary field is the first character. All the records that were appended through an Access append query have the same symptom. Yet, other records, that were input via a window in our ERP application, display the full text value. Do you think that appending to a binary field (when the data being appended is only simple text) might not fully succeed? It just seems odd that only the first character would appear. If you have any theories I would be willing to read them. None. As I said before, I've never dealt with this datatype. Sorry.- Hidequoted text - - Show quoted text - |
![]() |
| Thread Tools | |
| Display Modes | |
| |