HighTechTalks DotNet Forums  

Pervasive and Sqlbase fetches

Dotnet Framework (ODBC.net) microsoft.public.dotnet.framework.odbcnet


Discuss Pervasive and Sqlbase fetches in the Dotnet Framework (ODBC.net) forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
musclpete
 
Posts: n/a

Default Pervasive and Sqlbase fetches - 07-15-2005 , 11:04 AM






Ok I'm pretty new to VB.net and I need some help. Somehow I've been able to
get this far, but I'm stumped. I'm managed to connect to both my production
database (Sqlbase) and a distributed db (Pervasive) thru ODBC. What I'm
trying to do is compare tickets on both: tickets are entered into Pervasive
and then transferred thru to Sqlbase. Some tickets miss the transfer because
of setup reasons etc. I need to find those tickets that miss the transfer.
what I need done is:

{fetch tickets from pervasive for a particular day in ticketno order}
while not done
{fetch ticket nbr from sqlbase where ticket_nbr=ticketno and
sale_date=date above}

Here's the problem(s):
1. I'm getting a data not numeric when it DOESN'T find a ticket on sqlbase
(ie the result is Null not integer)
2. I get a DataReader associated with this command needs to be closed.

sSelect = "select ticketno from tkhist1 WHERE TicketDate=? order by ticketno"
cmdA.CommandText = "select ticketno from tkhist1 WHERE
TicketDate=? order by ticketno"
cmdA.Parameters.Add("ticdate",
Data.Odbc.OdbcType.Date).Value = TicDate.Value
Dim bReader As System.Data.Odbc.OdbcDataReader =
cmdA.ExecuteReader()
'MsgBox(cmdA.CommandText)
cmdQ.CommandText = "select ticket_nbr from sale where
co_nbr=80 and locn_id=1 and sale_date=? and ticket_nbr=?"
Dim cReader As System.Data.Odbc.OdbcDataReader = Nothing
While bReader.Read()
aTno = bReader.GetInt32(0)
cReader = cmdQ.ExecuteReader()
'sale_date=?
cmdQ.Parameters.Add("ticdate",
Data.Odbc.OdbcType.Date).Value = TicDate.Value
cmdQ.Parameters.Add("ticno",
Data.Odbc.OdbcType.Int).Value = aTno
Try
If Not cReader.IsDBNull(0) Then
'aQno = cReader.GetValue(0)
'If aQno = Nothing Then
tbA.Text = tbA.Text & " " & aTno.ToString
End If
Catch ex As Exception
MsgBox("Error if finding Quest ticket: " +
ex.ToString)
End Try
End While
bReader.Close()
End If


Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.