Migrated from Access 97 to SQL Server 8.0. CRecordset does not work anymore

From: Kjell Arne (anonymous_at_discussions.microsoft.com)
Date: 05/16/04

  • Next message: Kjell Arne: "RE: Migrated from Access 97 to SQL Server 8.0. CRecordset does not work anymore"
    Date: Sun, 16 May 2004 00:46:01 -0700
    
    

    Hi

    XP, VC++ VS 7.0 SQL Server 8.00.194, MDAC 2.8
    I have moved my database application from Access 97 to SQL Server 8.0.
    Unfortunately the code reading from the database through the ODBC driver does not work as expected. MFC CRecordset.
    I only get the first character of strings.
    E.g.
            CDBVariant Value;
            Recordset.GetFieldValue(pName, Value);
    where field pName is a string type I only get the first character of the string.
    Using the same code connected to an Access database works fine.
    I access a stored query in Access 97 and a View in the SQL Server.
    E.g.
    Recordset.Open(....SELECT * FROM <stored query in Access> or <View in SQL Server>....

    Also accessing the SQL Server I have to retrieve the data from the fields the recordset in the exact same order as the fields are ordered in the view.
    I don't use databinding.

    Have anyone experienced the same things and found a solution?
    Why don't I get the whole string from a field?
    Why do I have to acess the fields of the recorset in the same order as the fields are organized in the view in the SQL Server database?

    Look forward to hear from you.

    Regards
    Kjell Arne


  • Next message: Kjell Arne: "RE: Migrated from Access 97 to SQL Server 8.0. CRecordset does not work anymore"

    Relevant Pages

    • Re: Linking tables access - sql server 2005
      ... Another advantage of this method is that you don't need an ODBC setting on the local computer, ... Create a linked table to SQL Server without using a DSN ... Name of the table that you are linking to on the SQL Server database ... Function AttachDSNLessTable(stLocalTableName As String, stRemoteTableName As String, stServer As String, stDatabase As String, Optional stUsername As ...
      (microsoft.public.access.adp.sqlserver)
    • Re: Help: Login failed for User ???
      ... You can test database access by creating an empty file with as UDL extension ... The SQL Server will need to be a member server of the domain as will the ... I tried using the new version of the connect string and have the same ... I login Windows, Run application, I can get ...
      (microsoft.public.dotnet.framework.adonet)
    • Re: text datatype support
      ... Unicode or in the default character encoding of the database. ... True means that string parameters are sent to SQL Server in ...
      (microsoft.public.sqlserver.jdbcdriver)
    • Error Trap Connection to SQL server
      ... I am trying to establish links from Ms Access to tables in a SQL server ... the database is attached ... Dim rs1 As DAO.Recordset ... Dim strLinkName As String ...
      (microsoft.public.access.security)
    • Help with Error Trapping Connection to SQL server
      ... I am trying to establish links from Ms Access to tables in a SQL server ... the database is attached ... Dim rs1 As DAO.Recordset ... Dim strLinkName As String ...
      (microsoft.public.access.modulesdaovba)