Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming Languages - MoreVisual Basic Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old November 22nd, 2011, 02:29 PM
F.Degraeve F.Degraeve is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2011
Posts: 1 F.Degraeve User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 16 m 17 sec
Reputation Power: 0
Connection error only during start-up

Hi everyone,

I'm trying to make an ADO connection to a csv file. (path and file name stored in string “PathImportDataBanken”, file name in “BestandImportDataBanken”)

Every first time I start up my programme, the programme strands on the 'rs.open'-statement.

the error-screen I'm getting (it's in Dutch):
"Error # -2147467259 De geselecteerde instelling van de sorteervolgorde wordt niet ondersteund door het besturingssysteem."

(In english: "Error # -2147467259 The selected option for sorting is not supported by the operating system.")

Here's the connection-code: (VeldDatumImportDataBanken = date field)
PHP Code:
 Dim cnn As ADODB.Connection
    Dim rs 
As ADODB.Recordset
    Dim strSQL 
As String
    
    Set cnn 
= New ADODB.Connection
    Set rs 
= New ADODB.Recordset
    rs
.CursorLocation adUseClient
    
     cnn
.ConnectionString "Provider = Microsoft.Jet.OLEDB.4.0;Data Source=" _
                PathImportDataBanken 
";" _
                 
"Extended Properties=""text;HDR=YES;FMT=Delimited(;)"";" _
                 
"Persist Security Info=False"
     
cnn.Open

     strSQL 
"SELECT * FROM " BestandImportDataBanken "ORDER BY [" _
                
VeldDatumImportDataBanken "]"

     
rs.Open strSQLcnnadOpenDynamicadLockOptimistic 

I only receive the error when opening the programme for the FIRST time only... When I run the code a second or third time, no error appears.

When a change :
strSQL = "SELECT * FROM " & BestandImportDataBanken

everything works fine from start-up.

I'm using:
-Visual Basic for applications 7
-MS access 2010 reference to
• VB for applications
• MS access 14.0 Object Library
• OLE automation
• MS Office 14.0 access database engine object library
• MS VB for applications extensibility 5.3
• MS activeX data objects 6.0 library

-Vista

Your help and Time is appreciated.

Best Regards,

F.Degraeve, Belgium

Reply With Quote
  #2  
Old November 22nd, 2011, 03:31 PM
Doug G Doug G is offline
Grumpier Old Moderator
Dev Shed God 19th Plane (14000 - 14499 posts)
 
Join Date: Jun 2003
Posts: 14,256 Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level) 
Time spent in forums: 1 Month 4 Weeks 18 h 41 m 25 sec
Reputation Power: 4445
I have never used the jet provider for text csv files.

Doesn't ADO have a text file driver that may be easier? Just a guess, I have no idea on your problems, sorry.
__________________
======
Doug G
======
It is a truism of American politics that no man who can win an election deserves to. --Trevanian, from the novel Shibumi

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreVisual Basic Programming > Connection error only during start-up

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap