473,386 Members | 1,969 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

problem in connection

140 100+
giving error as [Microsoft][ODBC driver manager] data source name not found and no default driver specified.

Private Sub Savefile_Click()

CN.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=E:\Vb_image\Storyboard\storyboard.mdb;"


Set CN = New ADODB.Connection
Set RS = New ADODB.Recordset
CN.CursorLocation = adUseServer
CN.Open "storyboard.mdb"
Dim strmsacc As String
strmsacc = "SELECT * FROM story where projectId = '9999'"
RS.Open strmsacc, CN, adOpenDynamic, adLockOptimistic

RS.AddNew
SaveApp
RS.Update
Set RS = Nothing
Set RS = New Recordset
RS.Close
CN.Close

end sub

help me on this
Jan 20 '07 #1
5 4020
willakawill
1,646 1GB
giving error as [Microsoft][ODBC driver manager] data source name not found and no default driver specified.

Private Sub Savefile_Click()

CN.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=E:\Vb_image\Storyboard\storyboard.mdb;"


Set CN = New ADODB.Connection
Set RS = New ADODB.Recordset
CN.CursorLocation = adUseServer
CN.Open "storyboard.mdb"
Dim strmsacc As String
strmsacc = "SELECT * FROM story where projectId = '9999'"
RS.Open strmsacc, CN, adOpenDynamic, adLockOptimistic

RS.AddNew
SaveApp
RS.Update
Set RS = Nothing
Set RS = New Recordset
RS.Close
CN.Close

end sub

help me on this
Hi, you are opening the connection twice. Leave out the second one
CN.Open "storyboard.mdb"
and it should be fine
Jan 20 '07 #2
indhu
140 100+
Hi, you are opening the connection twice. Leave out the second one
CN.Open "storyboard.mdb"
and it should be fine

If i remove the second statement.

runtime error 3709
this connection cannot be used to perform this operation. It is either closed or invalid in this context.

option explicit

Dim CN As New ADODB.Connection
Dim RS As ADODB.Recordset

then save command follows.

help me out in this yeah
Jan 22 '07 #3
willakawill
1,646 1GB
If i remove the second statement.

runtime error 3709
this connection cannot be used to perform this operation. It is either closed or invalid in this context.

option explicit

Dim CN As New ADODB.Connection
Dim RS As ADODB.Recordset

then save command follows.

help me out in this yeah
This part:
Expand|Select|Wrap|Line Numbers
  1. CN.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=E:\Vb_image\Storyboard\storyboard.mdb;"
  2.  
  3.  
  4. Set CN = New ADODB.Connection
  5. Set RS = New ADODB.Recordset
  6.  
should be changed to:
Expand|Select|Wrap|Line Numbers
  1. Set CN = New ADODB.Connection
  2. Set RS = New ADODB.Recordset
  3.  
  4. CN.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data " _
  5.    & "Source=E:\Vb_image\Storyboard\storyboard.mdb;"
  6.  
  7.  
Jan 22 '07 #4
indhu
140 100+
This part:
Expand|Select|Wrap|Line Numbers
  1. CN.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=E:\Vb_image\Storyboard\storyboard.mdb;"
  2.  
  3.  
  4. Set CN = New ADODB.Connection
  5. Set RS = New ADODB.Recordset
  6.  
should be changed to:
Expand|Select|Wrap|Line Numbers
  1. Set CN = New ADODB.Connection
  2. Set RS = New ADODB.Recordset
  3.  
  4. CN.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data " _
  5.    & "Source=E:\Vb_image\Storyboard\storyboard.mdb;"
  6.  
  7.  
hi its working but showing error as runtime error 3704. operation is not allowed when the object is closed. but the records are saved to backend. can u just tell me why this error is coming.


Set CN = New ADODB.Connection
Set RS = New ADODB.Recordset

CN.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data " _
& "Source=E:\Vb_image\Storyboard\storyboard.mdb; "


Dim strmsacc As String
strmsacc = "SELECT * FROM story where projectId = '9999'"
RS.Open strmsacc, CN, adOpenDynamic, adLockOptimistic

RS.AddNew
SaveApp
RS.Update

Set RS = Nothing
Set RS = New Recordset
RS.Close error is coming here.
CN.Close

thank u
Jan 22 '07 #5
willakawill
1,646 1GB
hi its working but showing error as runtime error 3704. operation is not allowed when the object is closed. but the records are saved to backend. can u just tell me why this error is coming.


Set CN = New ADODB.Connection
Set RS = New ADODB.Recordset

CN.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data " _
& "Source=E:\Vb_image\Storyboard\storyboard.mdb; "


Dim strmsacc As String
strmsacc = "SELECT * FROM story where projectId = '9999'"
RS.Open strmsacc, CN, adOpenDynamic, adLockOptimistic

RS.AddNew
SaveApp
RS.Update

Set RS = Nothing
Set RS = New Recordset
RS.Close error is coming here.
CN.Close

thank u
When a recordset is open
RS.Open
you can close it with
RS.Close
Otherwise you will get an error. So tidy up at the end of your process with this

Expand|Select|Wrap|Line Numbers
  1. RS.Close
  2. Set RS = Nothing
  3. CN.Close
  4. Set CN = Nothing
Jan 22 '07 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Refky Wahib | last post by:
Hi I need Technical Support I finished a Great project using .Net and SQL Server and .Net Mobile Control My Business case is to implement this Program to accept about 1 Million concurrent...
1
by: Refky Wahib | last post by:
Hi Actually I need Technical Support I finished a Great project using .Net and SQL Server and .Net Mobile Control My Business case is to implement this Program to accept about 1 Million...
4
by: Rahul Anand | last post by:
Getting SQL Exception when trying to implement Connection based Trasaction using SQL Helper class. I am using the follwing function to execute my stored procs: -=-=-=- ExecuteScalar(ByVal...
8
by: BBC1009 | last post by:
I have an application connected to an overseas sql-server using port 1433. But recently it always timeout the connection. Any solution to avoid this??? I am using the VB.net Windowed Form with...
0
by: mortenol | last post by:
Hi, I am trying to connect a MS SSIS package to an AS400/DB2 database, and I experience problem when I hit the "Create Package" button in the "Data Link properties window". I have understood that...
5
by: Suresh | last post by:
Hi Guys I have Db2 server installed on remote server. i am connecting to that remote server by using VPN. I want to connect that remote DB2 server instance using my local machine DB2...
22
by: b_r | last post by:
Hi, I'm trying to make a simple operation (insert into DB) in VB 2005 and SQL Server. The code is as follows: Dim sConnectionString As String = _ "Data...
5
by: Usman Jamil | last post by:
Hi I've a class that creates a connection to a database, gets and loop on a dataset given a query and then close the connection. When I use netstat viewer to see if there is any connection open...
1
by: sherifbk | last post by:
Problem description ============== - I have 4 clients and 1 server (SQL server) - 3 clients are Monitoring console 1 client is operation console - Monitoring console collects some data from...
1
by: Ryan Liu | last post by:
Hi, I have a 100 clients/ one server application, use ugly one thread pre client approach. And both side user sync I/O. I frequently see the error on server side(client side code is same, but...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.