473,320 Members | 1,699 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,320 software developers and data experts.

i don't find any data in the new table

i have my little program that need to transfer about 1000 row from table 1 to new table that only contain that 1000 row i have transferred

note table1 contain about 10000 row
Expand|Select|Wrap|Line Numbers
  1. table1:-
  2. Public CLI1DT As New DataTable
  3. Public CLI1DA As New OleDbDataAdapter
  4.  
  5. new table:-
  6. Public CLI11DT As New DataTable
  7. Public CLI11DA As New OleDbDataAdapter
  8.  
  9.  
  10. CLI1DA = New OleDbDataAdapter("select *from EMP where SITE like'%" & ComboBox1.Text & "%'", Con1)
  11.         CLI1DA.Fill(CLI11DT)
  12.  
  13.         Dim save As New OleDbCommandBuilder(CLI11DA)
  14.         CLI11DA.Update(CLI11DT)
  15.         CLI11DT.AcceptChanges()
  16.         'CLI11DT.Clear()
  17.         CLI11DT_load()

the problem is i don't find any data in the new table
Aug 12 '18 #1
1 1349
zmbd
5,501 Expert Mod 4TB
mostafa10922

+ Looks like you are attempting to connect to an external database and transfer data into the Access database?

+ Are you attempting to use .Net or VB instead of VBA within an Access database - these will not directly work in VBA procedures - did you borrow the code from somewhere? you need to post either the code you are using or the link to the site you borrowed the code from so we can take a look.
OleDbDataAdapter -isn't standard in Access VBA
OleDbCommandBuilder - isn't standard in Access VBA
If you are trying to use .Net then we may need to move your thread so that people more acquainted with it will see your question.

+ Unless what you have listed are only the titles of custom VBA code then what you have will not work in an Access database - BTW: Connection Strings can be found here for the OleDbDataAdapter you need to verify that "CON1" is properly formed string.

+ Pull this out into a string variable:
strSQL = "(select * from EMP where SITE like '%" & ComboBox1.Text & "%'"
Now you can insert a debug.print strSQL to make sure the string is properly formed, (same for your CON1 )- 90% of issues are malformed strings when used directly within a function or subroutine call.
I fixed a few spacing issues here; however, I don't have your system so I can't go any further than that and without more information on your code to see if the connection is being properly called that's as much help as you could wish for with the string.
"%" hmmm, unless your access database is set for ansi92 access will not recognize this as a wild card and I cannot tell what database you are attempting to connect to so no help there... at some point you should try " * " for the wildcard. I've only found the " % " to work for pass through queries to Large Factor Databases such as MySQL, SQLServer,

+ IF you are working from within Access then you should also check to that your code is compiling properly - reopen the VBA editor
Menu>Debug>Compile
Fix any errors, it must compile without errors before we can go any further.
Aug 12 '18 #2

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

Similar topics

2
by: .Net Sports | last post by:
I have a data grid that takes data from a data table, and in visualstudio.net, I cannot find the error in the debugger at why I am not able to see my datagrid when querying data for a specific date...
8
by: Woody Splawn | last post by:
Lets say I have a winform that is populated with a dataset. The dataset and data table may have several rows in it. Lets say I am looking at the winform and I want to assign a value to a certain...
2
by: Brian Mitchell | last post by:
Ok, I know this is an elementary question but I have a data grid that is bound to a data table and I can't seem to find a way to match the selected row in the grid with it's respective row in the...
1
by: DH | last post by:
I have an untyped dataset with a table. I am trying to programmatically add a row to this table. This was working in VS 2003 / .net 1.1 I am receiving an error "Object reference not set to an...
0
by: tomzam | last post by:
I'm trying to get mysql working on Fedora Core 4. Actually trying to start the program mysqld without fatal errors. I posted this message first on the linux misc group - but no luck so far. Maybe...
1
by: Thamarai Selvi | last post by:
Hi, Actually i have created a data grid, which gets an input from the data table. Now i dont want to have the Duplicate values to be inserted in the grid. So Please help out of this.....
0
by: =?Utf-8?B?QklKVQ==?= | last post by:
Hai, I am very new in ASP.NET. I wnat to use Data Table in my project. For that When I created an instance variable of data Table like "Dim dtable as DataTable" I got an error mesage of "Type...
2
by: vjainpee | last post by:
Hi All, I m new to asp.net I want to make an excel file through code , and populate it throught a data table, this excel should be saved at some place on hard drive and should be opend...
7
by: sathyashrayan | last post by:
Dear group, A mysql wrapper class, which just uses the CRUD operations for large scale php development. Is the same advisable for the mysql stored procedure? Following is a link I got from...
3
by: Larry Leonard | last post by:
Running MSDE 2000 SP2 on Windows XP SP3. I have a T-SQL script that is relatively simple (adding constraints, inserting rows, etc.) and short (maybe 300 lines, heavily commented). It's an...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.