Click here to Skip to main content
15,891,253 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
I tried to debug and it gives error to me on MyConn.Open line:



Dim MyConn As New ADODB.Connection ' For Forecaster Access tables

Const ForecasterConnString As String = "DSN=Forecaster"

Dim i As Integer, strSQL As String, intRows As Integer
Dim PartNum As String, QtyReq As Double, DateReq As String, DateLoaded As Date, LoadedBy As String, strProdCode As String

MyConn.ConnectionString = ForecasterConnString
If MyConn.State <> adStateOpen Then
MyConn.Open
End If

What I have tried:

Please help me to bug the error as I am not able to upload the data into the system.
Posted
Updated 1-Jun-18 10:03am
Comments
Patrice T 1-Jun-18 14:24pm    
And you think you will tell us the exact error message ?
[no name] 1-Jun-18 14:26pm    
So it Shows you only "there is a runtime error"? In case it Shows more than this it would be helpfull to know that to help ;)

1 solution

You don't need to use a DSN at all. In this day and age, I wonder why anyone still bothers with them. It's just a connection string put in a place that'a a pain in the ass to manage.

If you made a System DSN, either the name you specified in your connection string doesn't exist or the connection string in the DSN definition is bad.

If you made a File DSN, the connection string in your app has to specify "FILEDSN=...". Of course, the name still has to match and the connection string in the DSN file has to be good.

We have no way of telling what's bad here. It's up to you to check this stuff.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900