473,805 Members | 2,001 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Whats the problem with this code?

Ali Rizwan
925 Contributor
Hi all,

i m having a problem with this code.
Actually i want to refresh connection by closing and opening it.
But the problem is that it do well when i update once but when i update it once more it gives me an error of
Microsoft jet database engine cannot find the input table or query 'Command1'. Make sure it exists and that its name is spelled correctely.

Expand|Select|Wrap|Line Numbers
  1. Private Sub Command1_Click()
  2.  
  3. Adodc1.Recordset.AddNew 0, Adodc1.Recordset.RecordCount + 1
  4.  
  5. End Sub
  6.  
  7. Private Sub Command2_Click()
  8.  
  9. Adodc1.Recordset.AddNew 0, Adodc1.Recordset.RecordCount + 1
  10.  
  11. End Sub
  12.  
  13. Private Sub Command3_Click()
  14.  
  15. If DE.Connection1.State = adStateOpen Then
  16. DE.Connection1.Close
  17. End If
  18.  
  19. DE.Connection1.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\Anwar-ul-Quran\Data\Dict\Dict.mdb;Persist Security Info=False"
  20. DE.rsCommand1.Source = "Table1"
  21.  
  22. DR.DataMember = "Command1"
  23. DR.Sections("Section1").Controls("Text1").DataMember = "Command1"
  24. DR.Sections("Section1").Controls("Text1").DataField = "No"
  25.  
  26. DR.Show
  27.  
  28. End Sub

One more question.

I m using this code for refreshing a command in dataenvironment .
Expand|Select|Wrap|Line Numbers
  1. DE.rsCommand1.Requery
but it is giving me an error that
Operation is not allowed when connection is closed.

Both codes are not same they are used in different applications.

So please do not mix up the both codes, take them seperatelty.


Thanx a lot
Nov 8 '07 #1
0 1045

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

Similar topics

4
4067
by: asdf | last post by:
Hello! Can someone tell me whats wrong with this piece of code: Option Compare Database Option Explicit Sub retrieve() Dim rst As ADODB.Recordset Dim i As Integer
21
2041
by: Paul Tremblay | last post by:
Hi All, I am a veteran C/C++ programmer (Unix background) and I want to get to speed with Visual Studio .Net I have legacy C/C++ code that I want to use in my application. However, I'm not sure how to call my native C++ functions from my C++ DLLs. The confusion is this: I currently have Visual Studio 2003 it is not clear whether I should use managed extensions or C++/Interop?
2
2572
by: Showjumper | last post by:
Whats the diff between the 2 and when do you use one and not the other?
8
1644
by: buc | last post by:
I have a simple combox on the screen that is bound via a datareader to a stored proc in sql that returns a simple string. The code is 'load stored proc then dReader = tmpSQL.SQLcmd.ExecuteReader() combobox1.DataSource = dReader dReader.Read() combobox1.DataTextField = dReader.GetName(0) combobox1.DataBind()
3
1762
by: Vaidas Gudas | last post by:
I has web project on virtual pc, maked with framework 2.0. there I was used the method role.roleexists("admin") and everything was worked good. but when i replace this project on my local machine, where is installed both versions 1.1 and 2.0 of framework. And on the this method I am getting the error System.Web.HttpException was unhandled by user code ErrorCode=-2147467259 Message="Unable to connect to SQL Server database."...
4
2772
by: sophie | last post by:
Whats going on here: Read in a number as a string: scanf("%s", &number); number = 12345, for arguements sake Print it like this its fine:
2
8852
by: Aaron Gray | last post by:
Whats going on with setAttribute on IE it appears to work on some examples and working code but not on other code that I am writting ? <style> .foo { font-size: 200%; } </style>
4
3085
by: LoneHunter01 | last post by:
Basically, I just need a general direction on where to go for this. Yes, this is for a school project, though it's strictly an optional one (and I have tried many solutions, one in-depth). We've only covered a few types of data struct (vectors, heaps, stacks, queues, deques, lists, linked lists, priority queues, trees, etc.). I need to be able to read in a file and keep track of the number of times a word appears and then print out based...
5
2323
by: islayer | last post by:
can someone tell me what is wrong with the bold code? i am just learning perl. the program should create a perl file with a random name (5 letters, followed by a number), but the name is always just the number. whats wrong with my code? #!/usr/bin/perl use Fcntl; @array = (a..z); srand; foreach (1..5) { $name = int(rand scalar(@array));
1
1446
by: x40 | last post by:
I try to learn python thru solving some interisting problem, found google trasure hunt, write first program ( but cant find whats wrong). # Unzip the archive, then process the resulting files to obtain a numeric result. You'll be taking the sum of lines from files matching a certain description, and multiplying those sums together to obtain a final result. Note that files have many different extensions, like '.pdf' and '.js', but all...
0
10604
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10356
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10361
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10103
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9179
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5536
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4316
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3839
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3006
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.