Hi all,
I have a problem of urgent nature . I am using Oracle and VB6 for an application . i am using ADODB coding
In oracle i have created a table and trying to connect thru vb form. the vb code is giving an error "either eof or bof is true or the current record has been deleted "
When i try to use some other tables already there in oracle , with the same code ,its working fine. Also i have tried to use ADODC in place of ADODB coding ,then also same problem persists with my table, whereas already made tables in oracle work fine.
thx n regards
19 3861
ensure that there is some record in the database table.
thx for ur prompt reply , there are records in the table and on form load i want to show the first record so i use movefirst of recordset, but still it gives eof or bof is true or current record has been deleted , the same code is working fine with the sample tables already in oracle like emp or dept.
the same code is working with one more table i created , but the difference b/w the 2 tables is that second table doesn't have any field of char type whereas first has. can that be the problem with oracle8, i am trying to use varchar2 in place of that
thx once again
you need to check for BOF and EOF while moving through the recordset.
CHAR OR VARCHAR IS NOT A PROBLEM.
check for BOF is before moving to first record.
try like -
if rs.bof =false then
-
rs.movefirst
-
.....
-
....
-
i have checked that, though there are records in the table , which i am able to see at sql prompt thru a simple sql query , i get rs.eof and rs.bof both as true.
then what cude be the problem?
is it related to user rights or privileges etc. problem is coming only with tables i have created, i am using login scott, tiger, shud i login thru some other user?
That could be the least likely cause.
Is that table in scott schema itself.
and what is the type of cursor you are using.
ya its in scott user and cursor type i am using is adopendynamic,locktype is adlockoptimistic , later in order to trace the problem ,i have tried to use refresh method of recordset object also but i am not sure its the correct soln or not
thx
i have checked that, though there are records in the table , which i am able to see at sql prompt thru a simple sql query , i get rs.eof and rs.bof both as true.
then what cude be the problem?
At SQL prompt, give exactly the query which adodb is passing to the oracle and see whether anything comes out. I guess, problem is that even if there are records in the table, the query you are passing is yielding no rows.
This can be checked as under also:
rs.open "..............."
if rs.recordcount<>0 then
rs.movefirst
end if
Just try it.
ya its in scott user and cursor type i am using is adopendynamic,locktype is adlockoptimistic , later in order to trace the problem ,i have tried to use refresh method of recordset object also but i am not sure its the correct soln or not
thx
is the problem still persisting ?
i am using adcmdtable , i.e. select * from tablename , and the same query i am executing from sql prompt which is returning resultset.
thx
i am using adcmdtable , i.e. select * from tablename , and the same query i am executing from sql prompt which is returning resultset.
thx
is that not returning any result from VB ?
I have a form in vb, controls on that form are a text box, command button , hflexgrid.
My requirement is that when user enters a number in text box , and clicks on command button , recordset should be opened according to a query matching the value entered in textbox , and flexgrid should be associated with recordset and shud display results.
Now this whole thing is working fine with emp table of oracle, but when I execute same thing with table created by me (login – scott, tiger) , it gives recordset.eof and recordset.bof both as true.
When I execute the same query with my table from sql prompt , it shows records in the table.
I have even tried the simplest case, I have even tried using adcmdtable, i.e not giving any criteria for search, instead all the records of table, but still it gives eof and bof as true.
Also I have tried using adodc, but no use.
This problem is not coming with all students, I am unable to identify what is the cause of the problem.
I am clueless, and puzzled , plz help me solve this problem early, since students’ project for class xii is stuck bcos of this.
Ps: can it be related to rights or privileges ?
Code -
-
Private Sub Command1_Click()
-
e = Trim(Text1.Text)
-
'Opening Connection
-
-
Set adoconn = New ADODB.Connection
-
adoconn.ConnectionString = "provider =MSDAORA; user id=scott; password=tiger;"
-
adoconn.CursorLocation = adUseClient
-
adoconn.Open
-
'Opening record set
-
Set adorsexp = Nothing
-
Set adorsexp = New ADODB.Recordset
-
-
adorsexp.CursorType = adOpenDynamic
-
adorsexp.LockType = adLockOptimistic
-
st = " select * from emp where empno = " + e
-
-
'emp is already made table in oracle
-
'************* working fine with emp table
-
-
‘have tried both the following
-
'st = " select * from scott.hrd_office where exp= " + e
-
'st = " select * from hrd_office where exp= " + e
-
-
'hrd_office is a table with 2 columns eno (pk ) and exp both number type
-
-
adorsexp.Open st, adoconn, , , adCmdText
-
MsgBox (st)
-
MsgBox (adorsexp.EOF)
-
MsgBox (adorsexp.BOF)
-
Do While (Not (adorsexp.EOF))
-
MsgBox (adorsexp.Fields("empno").Value)
-
adorsexp.MoveNext
-
Loop
-
-
'Set MSFlexGrid1.DataSource = adorsexp
-
'flexgrid being associated with recordset
-
'****** error coming on above line - object variable or with block variable not set
-
-
End Sub
-
try to use as following sample code. -
Sql = "select * from scott.hrd_office where exp= " & e
-
rs.Open Sql, con, adOpenForwardOnly, adLockReadOnly
-
Set MSHFG.Recordset = rs
-
rs.Open Sql, con, adOpenForwardOnly, adLockReadOnly
same problem persists with the above changes also.
Set MSHFG.Recordset = rs
This also doesn't works , it gives error - no such data member exists
rs.Open Sql, con, adOpenForwardOnly, adLockReadOnly
same problem persists with the above changes also.
Set MSHFG.Recordset = rs
This also doesn't works , it gives error - no such data member exists
The control used in the previous code is a hierarchical flex grid . Try using the same control.
The control used in the previous code is a hierarchical flex grid . Try using the same control.
i am using hierarchial flex grid control only
i am using hierarchial flex grid control only
But that piece of code works percectly for me.
Ensure that you have used the SET keyword.
flex grid problem solved , small mistake was there in name of control,
one cause of problem i found was name of table having underscore, but after correcting that , now my code is working for my table but only when i use primary key in where clause , when i try to use non pk column and make query ,for that again it is showing previous error.
my table is hrd1 having columns empno (pk) and exp1 (experience), , both number type,
when i give query
st= 'select * from hrd1 where empno=' & text1.text
it works fine ,but for query
st= 'select * from hrd1 where exp1=' & text1.text
it is not working
thx n regards
flex grid problem solved , small mistake was there in name of control,
one cause of problem i found was name of table having underscore, but after correcting that , now my code is working for my table but only when i use primary key in where clause , when i try to use non pk column and make query ,for that again it is showing previous error.
my table is hrd1 having columns empno (pk) and exp1 (experience), , both number type,
when i give query
st= 'select * from hrd1 where empno=' & text1.text
it works fine ,but for query
st= 'select * from hrd1 where exp1=' & text1.text
it is not working
thx n regards
hi,
is the field u r verfying is of type number. why can't u try to use
e = val(text1.text)
also check whether u've used any keyword as the fieldname in the table. The fieldname : Name, date like this also will affect the execution of the query.
regards,
vijay
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Jan Bols |
last post by:
I've been trying to install Oracle 8.1.7 on a fresh Mandrake 9.1 O.S for
days, but I'm still not able to get it running. I've tried several
install instructions that I found on the internet but no...
|
by: Cherrish Vaidiyan |
last post by:
hello,
I am been getting mad with so many doubts and errors..
I have posted some doubts,test cases regarding listener,replication
and standby database.But i havent got any response..(I am...
|
by: Si |
last post by:
Hi,
I am having trouble with an install of Oracle 9i Release 2 on Linux
Mandrake 9.1. I have 512 MB DDR RAM and a Duron 850 CPU.
The install appeared to run fairly seamlessly except for a...
|
by: kamil |
last post by:
Hi ,
I’am having the following strange situation.
First let me explain the configuration:
Windows 2000 server with sql-server and running reportingservices.
HP9000 Unix server with oracle...
|
by: Chris Botha |
last post by:
The machine is running XP Pro with all the latest service packs, etc. I must
access an Oracle database so I installed the Oracle client stuff. I can
query Oracle from a Windows app, no problem....
|
by: petro |
last post by:
I am trying to deploy an asp.net application to my web server. My
application uses system.data.oledb to connect to an oracle database. On my
development machine I have the oracle client 10g...
|
by: petro |
last post by:
Hello all,
My asp.net web application works on my machine but I get the following error
on our test web server, There is only one oracle home on the test server.
Does anyone know how to resolve...
|
by: BookerW |
last post by:
I am not sure which forum I should post this on, but here is the problem. I
have a front end web application(VB) on asp,net 1.1 framework. Inside of the
code, I have the following lines to...
|
by: Michael Rudolph |
last post by:
Hi newsgroup,
I have an issue with the configuration of a DB2 federated database
(WebSphere Information Integrator) in conjunction with the relational
wrapper for Oracle on AIX. DB2 seems to not...
|
by: Martin Solveig |
last post by:
Hello,
SLES9 SP1 is on PIII with two 800MHz procesors and 2GB RAM,
on four SATA 156GBhard disks are created two RAID1 arays,
on one RAID is OS with 1GB swap and Oracle 10.1.0.4 enterprise edition,...
|
by: DolphinDB |
last post by:
Tired of spending countless mintues downsampling your data? Look no further!
In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
|
by: ryjfgjl |
last post by:
ExcelToDatabase: batch import excel into database automatically...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: jfyes |
last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
|
by: PapaRatzi |
last post by:
Hello,
I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: Defcon1945 |
last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
|
by: af34tf |
last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome former...
| |