473,386 Members | 1,733 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.

how to add data to database ?

i dont want use insert sql query
got other way to do ?

Expand|Select|Wrap|Line Numbers
  1.  
  2. Dim cn As New ADODB.Connection
  3. Dim rs As New ADODB.Recordset
  4. Dim strCNString As String
  5.  
  6. strCNString = "Data Source=" & App.Path & "\final.mdb"
  7. cn.Provider = "Microsoft Jet 4.0 OLE DB Provider"
  8. cn.ConnectionString = strCNString
  9. cn.Open
  10.  
  11. Dim sql As String
  12.     sql = "SELECT sum(salary), name, gender FROM abc GROUP BY name, gender"
  13.     Set rs = cn.Execute(sql, , adCmdText)
  14.  
  15.       With rs
  16.  
  17.         .Fields("salary").Value = txtSalary.Text        
  18.         .Fields("name").Value = txtName.Text
  19.         .Fields("gender").Value = txtGender.Text
  20.  
  21.       End With
  22.  
  23.  
Apr 4 '07 #1
1 1106
Dököll
2,364 Expert 2GB
i dont want use insert sql query
got other way to do ?

Expand|Select|Wrap|Line Numbers
  1.  
  2. Dim cn As New ADODB.Connection
  3. Dim rs As New ADODB.Recordset
  4. Dim strCNString As String
  5.  
  6. strCNString = "Data Source=" & App.Path & "\final.mdb"
  7. cn.Provider = "Microsoft Jet 4.0 OLE DB Provider"
  8. cn.ConnectionString = strCNString
  9. cn.Open
  10.  
  11. Dim sql As String
  12.     sql = "SELECT sum(salary), name, gender FROM abc GROUP BY name, gender"
  13.     Set rs = cn.Execute(sql, , adCmdText)
  14.  
  15.       With rs
  16.  
  17.         .Fields("salary").Value = txtSalary.Text        
  18.         .Fields("name").Value = txtName.Text
  19.         .Fields("gender").Value = txtGender.Text
  20.  
  21.       End With
  22.  
  23.  
How do you mean? I am certain there are many ways to retrieve with minimal coding. I can't see how this can be achieved without writing actual SQL, especially if you are looking at grabbing data out of database columns, rows, and so on. Please continue to stay tuned, other, more qualified specialists here may know of some tricks that'll help you through...
Apr 4 '07 #2

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

Similar topics

0
by: sedefo | last post by:
I ran into this Microsoft Patterns & Practices Enterprise Library while i was researching how i can write a database independent data access layer. In my company we already use Data Access...
0
by: Stylus Studio | last post by:
DataDirect XQuery(TM) is the First Embeddable Component for XQuery That is Modeled after the XQuery API for Java(TM) (XQJ) BEDFORD, Mass.--Sept. 20, 2005--DataDirect Technologies...
4
by: intl04 | last post by:
How do I create a data input form in Access that is external to the Access database to which it's connected (if that's possible, which I believe it is)? For example, if someone clicks on an Access...
1
by: Johann Blake | last post by:
I am looking for a good solution on how to implement data access in an application so that there is a clean separation between the data access layer, the business layer and the GUI layer. I am...
5
by: Rich | last post by:
Hi there, For a quite big application, I need to get large amount of data within a static library (xxx.lib) and put them in a database (a class, say we call it CData), and then make it...
5
by: rogsonl | last post by:
My computer was moved last week, and the company changed the network groups we work on. As a result, one of the main benefits from Whidbey (database connectivity) no longer works. Situation: 1....
12
by: Chris Springer | last post by:
I'd like to get some feedback on the issue of storing data out to disk and where to store it. I've never been in a production environment in programming so you'll have to bear with me... My...
4
by: JIM.H. | last post by:
Hello, I am trying to write the data I got from a web service to my table in SQL Server I need to append the dataset wsDS to the dataset ds and do update. PVS.myWS.Loader load = new...
5
by: AAJ | last post by:
Hi all FIRST THE BORING BITS....... I normally use a Database layer, a Business layer and a GUI layer. The GUI uses an Object data source to bind to the Business layer which in turn binds...
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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,...
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.