Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
C

CCG3

@CCG3
About
Posts
62
Topics
26
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • How to round a double correctly... [modified]
    C CCG3

    Thanks Dave, I think I understand what you are saying... on further testing, I ran these lines just like this... Dim DisTest As Double = 1.255 / 100 MsgBox(DisTest) DisTest = Round(DisTest, 2, MidpointRounding.AwayFromZero) MsgBox(DisTest) Dim DisTest2 As Decimal = 1.255 / 100 MsgBox(DisTest2) DisTest2 = Round(DisTest2, 2) MsgBox(DisTest2) They both gave the same results. (.01) And you are saying that I would be better off to just use Decimal. The preceeding example is all I would have to change right? Instead of using Double change it to Decimal and leave out the MidpointRounding.AwayFromZero. right?

    Visual Basic csharp tutorial

  • How to round a double correctly... [modified]
    C CCG3

    Thanks Guffa, I caught that earlier (stated it further down in the posts).

    Visual Basic csharp tutorial

  • How to round a double correctly... [modified]
    C CCG3

    [Message Deleted]

    Visual Basic csharp tutorial

  • How to round a double correctly... [modified]
    C CCG3

    Hey Dave, thanks for your reply. Doesn't MidpointRounding.AwayFromZero fix what you are refering to? I was having a similar problem that you descriped and it took care of it. I was doing this.. Dim DisTest As Double = 2.5 / 100 Round(DisTest, 2) And my return was .02 instead of .03 like I would expect. Now I am doing this... Dim DisTest As Double = 2.5 / 100 Round(DisTest, 2,MidpointRounding.AwayFromZero) And now my return is .03 just as I would expect it to be. I am only asking because accuracy is important and it seems to be pretty accurate as of now. But are you saying if I had 1.255 / 100 then it wouldn't be accurate?

    Visual Basic csharp tutorial

  • How to round a double correctly... [modified]
    C CCG3

    Yes I was doing that(Math.Rounding) but I wasn't resigning the variable the new value. That works just fine. Thanks!!

    Visual Basic csharp tutorial

  • How to round a double correctly... [modified]
    C CCG3

    I tried.... Dim DisTest As Double = Me.TermDiscPct / 100 Round(DisTest, 2, MidpointRounding.AwayFromZero) and it didn't make any difference

    Visual Basic csharp tutorial

  • How to round a double correctly... [modified]
    C CCG3

    I tried.... Dim DisTest As Double = Me.TermDiscPct / 100 Round(DisTest, 2, MidpointRounding.AwayFromZero) and it didn't make any difference I don't want to create a function just for this. It seems like there should be a way to just round this with that much overhead.

    Visual Basic csharp tutorial

  • How to round a double correctly... [modified]
    C CCG3

    I am working with VB.Net 2005, I have a double that is coming up as .025 and I need to round it correctly. So it should show as .03 once this is done. I currenlty do this and it doesn't seem to work... Dim DisTest As Double = 2.5 / 100 Round(DisTest, 2)

    modified on Tuesday, November 11, 2008 11:15 AM

    Visual Basic csharp tutorial

  • VB 6 to VB.Net syntax...
    C CCG3

    I am working with VB.Net 2005 and I am re-writing a small program that was in VB6 format. I currently have a Dataset looking at my Access database. In the old code it used these statements to look at the database. Public dbComp As DAO.Database Dim qdf As DAO.QueryDef Dim tdf As DAO.TableDef The routine that I am working with looks at the database (dbComp) and it deletes quries and creates them and then populates them. I am hoping that I can use my existing Dataset that I created instead of using these DAO connections. Can anyone help me out with this? I just need to know what I can use in .Net in place of those commands above. Thank you in advance for any help you can provide!

    Visual Basic csharp database help question

  • Database Login window...
    C CCG3

    I am working with VB.Net 2005 looking at an Access 2003 database. When I run my Crystal Report (version 10.0.5.1279) I get a Database Login screen even though I don’t have passwords set at all in this datatbase. Can anyone tell me of a way to stop this from coming up? Thanks in advance for all of you help.

    Visual Basic csharp database help question

  • Count records using a wildcard...
    C CCG3

    Thank you very much Noctris, I will give that a shot. But most importantly I will remember this advice. In this case the text boxes are masked and only accept numeric characters, no symbols at all (not even positive/negative). But thanks again for helping you do a great job and it is much appreciated!!!

    Visual Basic question csharp help

  • Count records using a wildcard...
    C CCG3

    thanks, this is what I did to get past this issue and I have tested it several times and it works fine... 'Check to make sure the Current Department already exisits Dim Count2 As Integer = 0 Using Connection As New OleDbConnection _ ("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Comet 631 Databases\Converted to 2003\C022008.mdb") Dim cmd As OleDbCommand = New OleDbCommand _ ("Select Count(ActAcct) as ExistingRecords From [SHACT] where (ActAcct) Like '" & Me.txtCurGL.Text & "%'", Connection) Connection.Open() Count2 = CInt(cmd.ExecuteScalar) End Using 'if the Current Department doesn't exisit then throw message and exit sub If Count2 <= 0 Then MessageBox.Show("The GL Department " & Me.txtCurGL.Text.ToString & " does not exisit.", _ "Copy Department", MessageBoxButtons.OK) Me.txtCurGL.Focus() Me.txtCurGL.SelectAll() Return End If

    Visual Basic question csharp help

  • Count records using a wildcard...
    C CCG3

    Thank you for your reply Noctris. This is what I have now, but I don't think the wildcard is working because no matter what I enter it doesn't find a Count (always 0). Any idea what I might be doing wrong now? 'Check to make sure the Current Department already exisits Dim Count2 As Integer = 0 Using Connection As New OleDbConnection _ ("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Comet 631 Databases\Converted to 2003\C022008.mdb") Dim cmd As OleDbCommand = New OleDbCommand _ ("Select Count(ActAcct) as ExistingRecords From [SHACT] where (ActAcct)= @CurrDepart", Connection) cmd.Parameters.AddWithValue("@CurrDepart", Me.txtCurGL.Text.ToString & "%") Connection.Open() Count2 = CInt(cmd.ExecuteScalar) End Using 'if the Current Department doesn't exisit then throw message and exit sub If Count2 <= 0 Then MessageBox.Show("The GL Department " & Me.txtCurGL.Text.ToString & " does not exisit.", _ "Copy Department", MessageBoxButtons.OK) Me.txtCurGL.Focus() Me.txtCurGL.SelectAll() Return End If

    Visual Basic question csharp help

  • Count records using a wildcard...
    C CCG3

    I am working with VB.Net 2005 and I am looking at an Access 2003 mdb. I need to look into a table and see if any records exists that have a value in a certain field based on what is keyed in from a text box...here is what I have so far. I think I am close but when I get to the line "Count2 = CInt(cmd.ExecuteScalar)" I get error..."No value given for one or more required parameters." So I am certainly missing something. 'Check to make sure the Current Department already exisits Dim Count2 As Integer = 0 Using Connection As New OleDbConnection _ ("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Comet 631 Databases\Converted to 2003\C022008.mdb") Dim cmd As OleDbCommand = New OleDbCommand _ ("Select Count(ActAcct) as ExistingRecords From [SHACT] where (@CurrDepart)=?", Connection) cmd.Parameters.AddWithValue("@CurrDepart", OleDbType.VarChar).Value = Me.txtCurGL.Text.ToString + "%" Connection.Open() Count2 = CInt(cmd.ExecuteScalar) End Using 'if the Current Department doesn't exisit then throw message and exit sub If Count2 <= 0 Then MessageBox.Show("The GL Department " & Me.txtCurGL.Text.ToString & " does not exisit.", _ "Copy Department", MessageBoxButtons.OK) Me.txtCurGL.Focus() Me.txtCurGL.SelectAll() Return End If

    Visual Basic question csharp help

  • Passing an Access wildcard from VB.Net 2005
    C CCG3

    Thanks, that is exactly what I needed!

    Visual Basic database csharp help question

  • Passing an Access wildcard from VB.Net 2005
    C CCG3

    I am working wiht VB.Net 2005 and I am looking at an Access 2003 database. I can run a Delte query in Access and it works fine. But when I try to run the same query from my program it doesn't delete anything. Can someone tell me what I doing wrong? Thanks so much for your help with this.... Cursor = System.Windows.Forms.Cursors.WaitCursor 'Build SQL to delete this department Dim TempDepartNum As String = Me.txtDepartNum.Text Dim Sql As String = String.Empty 'initialize database connection Dim Connection As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Databases\Converted to 2003\C022008.mdb") 'set up SQL command to delete records 'DELETE SHACT.ActAcct, *FROM(SHACT) WHERE (((SHACT.ActAcct) Like '100*')); Sql = "DELETE * FROM SHACT WHERE (((SHACT.ActAcct) Like '100*'));" Try 'connect to the database and delete the records Connection.Open() Dim Command As New OleDbCommand(Sql, Connection) Command.ExecuteNonQuery() MessageBox.Show("Delete Department function completed successfully.", "Delete", MessageBoxButtons.OK)

    Visual Basic database csharp help question

  • Update/change Database field...
    C CCG3

    I am working with VB.Net 2005 and I am looking at an Access 2003 database. What I need to do is open the database, look for a certain value (coming from text box 1) in a certain table (APCHK) and every one of them with that value replace/update with a different specified value (coming from text box 2),then close the database. What would be the best way to do this? Thanks for any advice you can give me with this.

    Visual Basic csharp database question announcement

  • Error – 3085 DAO. Database – Undefined function ‘DSUM’ in expression [modified]
    C CCG3

    Yes I agree that VB6 is "officially' dead. And I have no less than 3 other programs that are written in VB.net 2005. But for this project I have to convert it to VB6 before I can more forward to .Net and I have it at least 90 percent converted but there are several places in this code that uses the scenario that I presented in my question. That is why I am asking for help.

    Visual Basic help database question

  • Error – 3085 DAO. Database – Undefined function ‘DSUM’ in expression [modified]
    C CCG3

    I am sorry I thought this form said Visual Basic / VB.Net which I thought meant that you could post any questions in here regarding Visual Basic. Can someone help me with the question that I posted? This is probably a very easy answer that others have come across in the past and know exactly how to handle it. I don't understand what drives some people to waste their time by going in and out of forums making stupid comments and judging others instead of helping that person with the situation at hand (do you really have to try and make others feel bad to make yourself feel better?). I don't think I have to justify the reason that I am converting to VB6 or what I plan to do with this code once it is in VB6.

    Mycroft Holmes wrote:

    The temptation to be rude is sooo strong but I'll refrain.

    ...right back at ya buddy!

    Visual Basic help database question

  • Error – 3085 DAO. Database – Undefined function ‘DSUM’ in expression [modified]
    C CCG3

    I am working with VB6 looking at an Access 97 database. What I am doing is converting VB5 code to VB6. I have come across a problem where the code creates a Query in the Access file, then assigns that query to a Recordset (I know the query is fine because when I run open it in Access it shows the desired results). The problem is with some DSum, DMin, and DMax statements in the Query. It assigns the Query to the Recordset with no problem (.Data1.RecordSource = "SELECT qryJCDSSchedLU1.* FROM qryJCDSSchedLU1 ") but then it runs a refresh (.Data1.Refresh) and then this gives an error. (Error – 3085 DOA. Database – Undefined function ‘DSUM’ in expression.) If I remove the DSum then it gives me this error on the DMin, and if I remove that it gives me the error on the DMax. This works just fine in VB5 but not in VB6. Can anyone give me any suggestions on what I need to do to fix this? Thanks in advance for any help that you can give.

    modified on Thursday, January 31, 2008 3:21:19 PM

    Visual Basic help database question
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups