Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default xlodbc returning no rows & no errors

Have added in xlodbc.xla in Excel SR1 and inserted following code in to
activate worksheet

Private Sub Worksheet_Activate()
Dim Chan As Variant
Chan = SQLOpen("DRIVER={Microsoft ODBC for
Oracle};UID=username;PWD=password;SERVER=servernam e;")
If IsError(Chan) Then
XLODBCErrHandler
Exit Sub
End If
SQLExecQuery Chan, _
"SELECT CUST_PERSONAL_DETAILS.CUSTP_CUST_SEQNO,
CUST_PERSONAL_DETAILS.CUSTP_NI_CODE FROM SUMMIT.CUST_PERSONAL_DETAILS WHERE
(CUST_PERSONAL_DETAILS.CUSTP_NI_CODE=[Enter the NI Code])"
If IsError(Chan) Then
XLODBCErrHandler
Exit Sub
End If
SQLRetrieve Chan, ActiveSheet.Range("B3"), , , True
If IsError(Chan) Then
XLODBCErrHandler
Exit Sub
End If
SQLClose (Chan)
End Sub
Sub XLODBCErrHandler()

Dim ErrMsgs As Variant
Dim ErrCode As Variant

' Call SQLError to return error values to the variant
' ErrMsgs.
ErrMsgs = SQLError()

' Display each item in the ErrMsgs variant array.
For Each ErrCode In ErrMsgs
MsgBox ErrCode
Next

End Sub

My problem is that for some NI codes it returns no data but I know the rows
exist on the oracle database. The error handling throws up no errors. I'm an
oracle dba playing at using Excel for the first time and would appreciate any
help you can give.

--
S Boulton
  #2   Report Post  
Posted to microsoft.public.excel.programming
AL AL is offline
external usenet poster
 
Posts: 37
Default xlodbc returning no rows & no errors

I'm not familiar with Oracle SQL syntax, but from my
experience, you might want to check that you are entering
the Correct TYPE for the NI code. For instance, try
enclosing the NI code in single quotes.


-----Original Message-----
Have added in xlodbc.xla in Excel SR1 and inserted

following code in to
activate worksheet

Private Sub Worksheet_Activate()
Dim Chan As Variant
Chan = SQLOpen("DRIVER={Microsoft ODBC for
Oracle};UID=username;PWD=password;SERVER=serverna me;")
If IsError(Chan) Then
XLODBCErrHandler
Exit Sub
End If
SQLExecQuery Chan, _
"SELECT CUST_PERSONAL_DETAILS.CUSTP_CUST_SEQNO,
CUST_PERSONAL_DETAILS.CUSTP_NI_CODE FROM

SUMMIT.CUST_PERSONAL_DETAILS WHERE
(CUST_PERSONAL_DETAILS.CUSTP_NI_CODE=[Enter the NI Code])"
If IsError(Chan) Then
XLODBCErrHandler
Exit Sub
End If
SQLRetrieve Chan, ActiveSheet.Range("B3"), , , True
If IsError(Chan) Then
XLODBCErrHandler
Exit Sub
End If
SQLClose (Chan)
End Sub
Sub XLODBCErrHandler()

Dim ErrMsgs As Variant
Dim ErrCode As Variant

' Call SQLError to return error values to the variant
' ErrMsgs.
ErrMsgs = SQLError()

' Display each item in the ErrMsgs variant array.
For Each ErrCode In ErrMsgs
MsgBox ErrCode
Next

End Sub

My problem is that for some NI codes it returns no data

but I know the rows
exist on the oracle database. The error handling throws

up no errors. I'm an
oracle dba playing at using Excel for the first time and

would appreciate any
help you can give.

--
S Boulton
.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default xlodbc returning no rows & no errors

Used single & double quotes but still failed. For those NI codes that work
using quotes caused them to fail. Thanks anyway.

Steve

"Al" wrote:

I'm not familiar with Oracle SQL syntax, but from my
experience, you might want to check that you are entering
the Correct TYPE for the NI code. For instance, try
enclosing the NI code in single quotes.


-----Original Message-----
Have added in xlodbc.xla in Excel SR1 and inserted

following code in to
activate worksheet

Private Sub Worksheet_Activate()
Dim Chan As Variant
Chan = SQLOpen("DRIVER={Microsoft ODBC for
Oracle};UID=username;PWD=password;SERVER=serverna me;")
If IsError(Chan) Then
XLODBCErrHandler
Exit Sub
End If
SQLExecQuery Chan, _
"SELECT CUST_PERSONAL_DETAILS.CUSTP_CUST_SEQNO,
CUST_PERSONAL_DETAILS.CUSTP_NI_CODE FROM

SUMMIT.CUST_PERSONAL_DETAILS WHERE
(CUST_PERSONAL_DETAILS.CUSTP_NI_CODE=[Enter the NI Code])"
If IsError(Chan) Then
XLODBCErrHandler
Exit Sub
End If
SQLRetrieve Chan, ActiveSheet.Range("B3"), , , True
If IsError(Chan) Then
XLODBCErrHandler
Exit Sub
End If
SQLClose (Chan)
End Sub
Sub XLODBCErrHandler()

Dim ErrMsgs As Variant
Dim ErrCode As Variant

' Call SQLError to return error values to the variant
' ErrMsgs.
ErrMsgs = SQLError()

' Display each item in the ErrMsgs variant array.
For Each ErrCode In ErrMsgs
MsgBox ErrCode
Next

End Sub

My problem is that for some NI codes it returns no data

but I know the rows
exist on the oracle database. The error handling throws

up no errors. I'm an
oracle dba playing at using Excel for the first time and

would appreciate any
help you can give.

--
S Boulton
.


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 593
Default xlodbc returning no rows & no errors

Boultonsj wrote ...

Used single & double quotes but still failed. For those NI codes that work
using quotes caused them to fail. Thanks anyway.


What is the data type? Is there a pattern to the codes that fail e.g.
leading zeros, more than 16 digits, etc? Do they work if you hard code
them in the sql text?

Jamie.

--
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
vlookup returning Errors (ISNA formula) Nora[_2_] Excel Worksheet Functions 3 January 3rd 08 04:29 PM
Help on sumproduct returning errors Pierre Excel Worksheet Functions 2 November 16th 06 04:00 PM
VLOOKUP returning errors Dave F Excel Worksheet Functions 4 September 6th 06 06:35 PM
Formulas returning errors when reference columns are deleted Ian M[_2_] Excel Programming 1 May 3rd 04 07:51 AM
XLODBC Newman Excel Programming 0 November 3rd 03 01:56 AM


All times are GMT +1. The time now is 08:26 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"