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

Manipulating data from tables i various ways?

6
I am a superclumsy programmer i .net so far, and i need tips!
I made this function to get «saldo» :

Shared Function HentSaldo(ByVal saldo As Double) As Double
Dim cnn1 As New ADODB.Connection()
Dim rst1 As New ADODB.Recordset()
cnn1.Open("Provider=Microsoft.Jet.OLEDB.4.0;Data _ Source=C:\VB\Proj.mdb;")
'open recorset for rows
Dim str1 As String = "Select Sum(Debit),Sum(Kredit) From Balanse"

With rst1
.ActiveConnection = cnn1
.Open(str1, , _
ADODB.CursorTYpeEnum.adOpenForwardOnly, _
ADODB.LockTypeEnum.adLockReadOnly)
End With
Dim s_debit As Double
Dim s_kredit As Double
Dim s_saldo As Double
Do Until rst1.EOF
s_debit = CDbl(rst1("Debit").Value)
s_kredit = CDbl(rst1("Kredit").Value)
s_saldo = s_debit - s_kredit
rst1.MoveNext()
Loop

Return s_saldo
End Function

And this function return either nothing or errormessage om the connection.
And i have tryed to use classes, eks:

Public Sub getKredit()

Dim conn As New OleDb.OleDbConnection(connstr)
Dim kreditdap As New OleDb.OleDbDataAdapter("Select Kredit from_ SumKreditDebit", conn)
conn.Open()
kreditdap.Fill(dsKredit, "SumKreditDebit")
conn.Dispose()
dsKredit.Dispose()
conn.Close()

End Sub

This (SumKreditDebit) is a query and give me nothing in return when i call it.
Do anyone have som examples in how to take values in tables an manipulate then in a simple way?
Feb 16 '07 #1
2 1046
kenobewan
4,871 Expert 4TB
Your query returns nothing as you haven't given it enough information, like an ID... Here is an article that may help:
Server-Side Data Access
Feb 17 '07 #2
janero
6
Your query returns nothing as you haven't given it enough information, like an ID... Here is an article that may help:
Server-Side Data Access
This i should know...Thank you for your help:-)
Feb 20 '07 #3

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

Similar topics

5
by: Phil Powell | last post by:
I've read some online resources that utilize various MySQL command-line actions to migrate data from Access to MySQL. The situation is this: a group of co-workers of mine will be using an Access...
44
by: Mariusz Jedrzejewski | last post by:
Hi, I'll be very grateful if somebody can explain me why my Opera 7.23 (runing under linux) doesn't show me inner tables. Using below code I can see only "inner table 1". There is no problem with...
2
by: Sune | last post by:
Hi, I'm in the situation that i need to print (to paper) some documents from a database using a website, and i need to manipulate the data on the fly, but my problem is that i don't know how to...
10
by: Kristian Nybo | last post by:
Hi, I'm writing a simple image file exporter as part of a school project. To implement my image format of choice I need to work with big-endian bytes, where 'byte' of course means '8 bits', not...
2
by: serge | last post by:
My project is to automate testing of Stored Procedures of type SELECT (at least for now). I want to create a table where each stored procedure's input parameter values are entered and in another...
8
by: Steve Jorgensen | last post by:
Hi folks, I'm posting this message because it's an issue I come up against relatively often, but I can't find any writings on the subject, and I haven't been able to figure out even what key...
2
by: Wysiwyg | last post by:
I was hoping to get some opinions on the efficiency of various methods of reusing the same dropdown list data. Here is the situation: Multiple panels on maintenance pages with TAB menus across...
4
by: Markus | last post by:
Hello I use a table to cache some informations which need lots of resources to be composed. The first time the info is needed, it will be composed and written to the cache table ($db in the...
7
by: erikcw | last post by:
Hi, I'm working on a web application where each user will be creating several "projects" in there account, each with 1,000-50,000 objects. Each object will consist of a unique name, an id, and...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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...
0
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...
0
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...

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.