General ODBC Assistance

General ODBC Assistance

Post by pyrow.. » Wed, 29 Mar 2000 04:00:00



Howdy All!

I am just trying to learn ODBC connectivity. I really would like to
connect to a pre-established System DSN on the machine to pull the data
into my VB Application. Can anyone just point me in the right direction
on even accessing the database via the DSN? Even a website with some
reference material would be great!

Thanks in advance!

Sent via Deja.com http://www.deja.com/
Before you buy.

 
 
 

General ODBC Assistance

Post by news.callamer.co » Wed, 29 Mar 2000 04:00:00


If you are using ADO use the following code snippet to connect, then
retrieve data from an ODBC source:

Dim rsObject As Recordset
Dim sConnection As String

     sConnection = "User ID=uid;Password=pass;Data Source=test"
     sSQL = "Select * from pubs"
     Set rsObject = New Recordset
     rsObject.Open sSQL, sConnection

     With rsObject
          Do While Not .EOF
              sText  = .Fields("ID")
              sText = sText & ";" & .Fields("Name")   ' The field names are
in ""
               lstList.AddItem sText   '  This adds a line to a list box
               .MoveNext
         Loop
         .Close
   End With

   Set rsObject = Nothing

--
Remove the "x" from the end of the email address to respond


> Howdy All!

> I am just trying to learn ODBC connectivity. I really would like to
> connect to a pre-established System DSN on the machine to pull the data
> into my VB Application. Can anyone just point me in the right direction
> on even accessing the database via the DSN? Even a website with some
> reference material would be great!

> Thanks in advance!

> Sent via Deja.com http://www.deja.com/
> Before you buy.


 
 
 

1. Assistance Please: ODBC Error

System IIS 4.0, SQL 7.0

The error I am getting is:

Microsoft OLE DB Provider for ODBC Drivers error '80040e21'

[Microsoft][ODBC SQL Server Driver]String data, right truncation

Background:
    I am processing a form in ASP that is dynamic, I do not know how many
inputs or their type, it is all generated from the database.  This form does
contain <textarea> inputs that need to be stored in a table which allows for
them to be 5000 characters in length.  I have devised a plan to pass all
necessary parameters in 2 variables, one contains question id, response id
and type while the other contains the answers (each one padded to 5000
characters).  The store procedure I wrote processes everything just fine
when executed from the query manager, but when data is passed from the ASP
page I get the above error message.
    My suspicion is that I am exceeding what the ODBC driver can pass as a
text string.  Does anybody know what that limit might be?

Any other suggestions would be greatly appreciated.

2. Database Mining with Neural Nets

3. PC database

4. ODBC SDK Assistance needed :-)

5. Sybase Developer Wanted

6. General Bits Weekly Column for pgsql-general

7. system table maintenance

8. General ODBC Recordset

9. General SQL error.[ODBC Access Driver]Jet error -1003

10. General SQL error [ODBC SQL Server Driver]

11. [ODBC Microsoft Access 7.0 Driver]General error Failed to get the exp

12. Runtime Error '1004' General ODBC Error