CRecordset.Open() - Driver does not support dynaset
Ramachandra Rao -- chandu@ampersand.soft.net Saturday, November 23, 1996 Environment: Visual C++ 4.0, Win95 Hi I am trying to open a CRecordset of type dynaset. But I get the message "Driver does not support dynaset". The comments in the MFC code tell that, dynasets require odbc32.dll of version 2.0 . But the version of the odbc32.dll that comes with VC++ 4.0 is 2.50 . Then what could the problem be? I am trying to connect to SQLServer 6.5 . Is there any workaround for this problem or should I get a third party driver that supports dynasets.? Thanks Chandu
David J. Straley -- djs@cnj.digex.net Sunday, November 24, 1996 [Mini-digest: 2 responses] On Sat, 23 Nov 1996 00:23:45 +0530, you wrote: >Environment: Visual C++ 4.0, Win95 > >Hi > I am trying to open a CRecordset of type dynaset. But I get the message >"Driver does not support dynaset". The comments in the MFC code tell >that, dynasets require odbc32.dll of version 2.0 . But the version of >the odbc32.dll that comes with VC++ 4.0 is 2.50 . Then what could the >problem be? >I am trying to connect to SQLServer 6.5 .=20 Make sure you create a separate CDatabase object and then do an Open() on it, passing FALSE for the parameter for ODBC Cursor Lib, which is TRUE by default. You gotta get rid of that cursor lib for dynasets to work. Hang in there. :) Regards, Dave Straley David J. Straley, Software Developer =20 Windows * Windows NT * Unix/X Windows -- djs@cnj.digex.net -- -----From: Strhan MojmirHi Chandu! To use dynaset, you need: 1) switch-off usage of cursor library e.g. in CDatabase::Open() set (last) parameter bUseCursorLib to FALSE 2) switch-on cursor type DYNASET e.g. in CRecordset::Open() specify nOpenType as CRecordset::dynaset 3) if you call stored procedure, ensure that it is "simple SP" -> SP which contains one and only one SELECT statement These steps should enable usage of DYNASET to you. But I want to warn you: if you want to program application which should also work with other servers than Microsoft SQL Server 6.5, it is a bad practice to hardcode type of cursor in your code, because DYNASET will perhaps not be available on other SQL servers and/or drivers - for example Intersolv's ODBC driver for Microsoft SQL Server does not support DYNASETs. So if you need portable application, you should program yourself class COdbcWorkspace, which should deal with: -HDBC (CDatabase) mapping -> how many simultaneous HDBCs supports server and/or driver? -HSTMT (CRecordset) mapping -> how many simultaneous HSTMTs per HDBC supports server and/or driver -cursor type mapping -> which cursor types supports server and/or driver -stored procedures mappings -> which type of SP (simple versus complex) can you use with which cursor type If you program such a class, you will be able to port your application to other servers in few hours, because you will only need to port (enhance) COdbcWorkspace, not the rest of code. You cannot expect to see any code from me, because this code is rated "TOP SECRET" in our company. You also cannot expect to see such a class in next releases of MFC, because Microsoft is quite happy with hardcoded cursor types, because this means that you can only use Microsoft SQL Server :-) Hope this helps. Mojmir Strhan strhan_m@simultan.ch
Luke Stephens -- luker@tfs.net Sunday, November 24, 1996 SQL Server 6.0/6.5 comes with a new driver that supports dynasets. So far, the driver has worked for me. What kind of query are you doing? Did you know that the driver requires a unique index for dynasets to work with SQL Server? I think there is an article about this in the MSDN. Hope this helps Luke Stephens luker@tfs.net ---------- > From: Ramachandra Rao. S> To: 'MFC Mailing List' > Subject: CRecordset.Open() - Driver does not support dynaset > Date: Friday, November 22, 1996 12:53 PM > > Environment: Visual C++ 4.0, Win95 > > Hi > I am trying to open a CRecordset of type dynaset. But I get the message > "Driver does not support dynaset". The comments in the MFC code tell > that, dynasets require odbc32.dll of version 2.0 . But the version of > the odbc32.dll that comes with VC++ 4.0 is 2.50 . Then what could the > problem be? > I am trying to connect to SQLServer 6.5 . Is there any workaround for > this problem or should I get a third party driver that supports > dynasets.? > > Thanks > Chandu
| Вернуться в корень Архива |