|
-
Oct 12th, 2003, 02:04 AM
#1
Thread Starter
Member
[No one help m] Oracle dsn problem..
I'm firstly using Access as backend to my project, i connect to access using system Dsn.It woking fine.
Now i want to shift my database to oracle.So i created a System Dsn.I change only in my connection object, change its DSN to Oracle Dsn.Rest coding is same will it work
I'm connecting to oracle using DSN my connection is created but it cannot count record from database.There are records in my table.My coding for open database and to count recored as follow
code for connection opening
DIM CON AS NEW ADODB.CONNECTION
With Con
.Mode = adModeReadWrite
.Open "Provider=msdaora;" & _
"DSN=store2;" & _
"User Id=acme;" & _
"Password=acme"
END WITH
code to open recordset
RsUser.Open "select * from SUSER", Con, , , adCmdText
if RsUser.RecordCount=0 then
msgbox "No record"
end if
Can RecordSet.RecordCount will not work in oracle
Plase help me
Thanks lot
Last edited by spsingh; Oct 12th, 2003 at 08:06 AM.
-
Oct 12th, 2003, 05:42 AM
#2
Fanatic Member
This is connection string I use to work with Oracle databases:
Dim strConnection As String = _
"Provider=MSDAORA.1;User ID=MyID;Password=MyPassword;" _
& "Data Source =MyDatabaseService.MyDomain.com"
Do canibals not eat clowns because they taste funny? 
-
Oct 12th, 2003, 08:12 AM
#3
Thread Starter
Member
will rs.recordCount will not work with oracle.if i use it return -1.There are records in my table.
I used it with access it work well
my source to open connection is
Open "Data Source=store2;" & _
"User Id=scott;" & _
"Password=tiger"
please help me to count records from oracle
-
Oct 12th, 2003, 08:37 AM
#4
Frenzied Member
It looks to me like you haven't set your cursortype in your ADO connection.
By default it will use forward only which does not support recordcount.
Use either adOpenKeyset or adOpenStatic as the CursorType.
Mega.
"If at first you don't succeed, then skydiving is not for you"
-
Oct 12th, 2003, 10:20 AM
#5
Thread Starter
Member
no i'm using cursor type adopenkeyset but still it return record count -1.
Please help me to count record from oracle
-
Oct 12th, 2003, 12:51 PM
#6
Thread Starter
Member
I still not found any solution so please help.Is peet their
-
Oct 12th, 2003, 05:28 PM
#7
The CursorLocation could be causing the problem. By default CursorLocation is adServerSide, which will always return a RecordCount of -1. Access does not support ServerSide cursors. If you need the record count use a client cursor. Just make sure you understand the implications of using one over the other.
RsUser.CursorLocation = adClientSide
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|