cpopham 0 Junior Poster in Training

I tried that and also on the Public sub that is in the parent form I put it there as well, but it is still not working...

cpopham 0 Junior Poster in Training

I have a parent form that has a combobox. Whn the form loads I get the data from the db and bind to the combobox. that works fine and here is the code I use in form load to cause this to happen:

conn.Open()
        cmd.Connection = conn
        da = New SqlCeDataAdapter(cmd1, conn)

        cmd.CommandText = "SELECT * FROM AccountType ORDER BY AcctType"
        da2 = New SqlCeDataAdapter(cmd)
        da2.Fill(dtAcctType)

        cmd.CommandText = chkSQL
        daCk = New SqlCeDataAdapter(chkSQL, conn)
        daCk.Fill(dtChk)



        cboType.DataSource = dtAcctType
        cboType.DisplayMember = "AcctType"
        cboType.ValueMember = "AcctTypeID"
        cboType.SelectedIndex = 0

Now if there is not an Account Type, I have a button that will pull up a small form to allow the addition of an account type. The popup form adds the data back to the database just fine, but I am now trying to get the combobox to refresh its data. So I call a public Sub that is located in the parent form to from the popup form to accomplish this task and I have walked the code and the sub is called and appears to work correctly, but the new data never appears in the combobox. Here is my public sub that i call to try and refresh the combobox on the parent form.

Dim dtType As New DataTable
        Dim daType As SqlCeDataAdapter


        Try
            conn = New SqlCeConnection("Data Source=C:\Program Files\HomeComplete\Data\HomeComplete.sdf")
        Catch
        End Try

        Dim cmd As New SqlServerCe.SqlCeCommand

        cmd.Connection = conn

        cmd.CommandText = "SELECT * FROM AccountType ORDER BY AcctType"
        daType = New SqlCeDataAdapter(cmd)

        daType.Fill(dtType)
        cboType.Items.Clear()
        cboType.DataSource = …
cpopham 0 Junior Poster in Training

I am trying to learn VB .NET again. Have not used in a long time. I have bound my controls to my datatable and then I put values into the controls, I then have a button that I am trying to get to add/update the rows to the database. It acts like it works fine no errors or anything, but whn I look at the table data after the update, it is all null... ugg.. can someone please look at my code and tell me what I am doing wrong?

Dim conn As SqlCeConnection
    Dim da As SqlCeDataAdapter
    Dim dtAcct As New DataTable("Account")
    Dim dtAcctType As New DataTable("AccountType")


    Private Sub frmAccount_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Dim cmd As New System.Data.SqlServerCe.SqlCeCommand
        Dim cmd1 As String = "SELECT * FROM Account"
        Dim da2 As New SqlCeDataAdapter

        conn = New SqlCeConnection("Data Source=C:\Documents and Settings\Owner\Desktop\Finances\HomeComplete\Databases\HomeComplete.sdf")


        conn.Open()
        cmd.Connection = conn
        da = New SqlCeDataAdapter(cmd1, conn)
        Dim cmdBuild As SqlCeCommandBuilder = New SqlCeCommandBuilder(da)
        da.Fill(dtAcct)
        cmd.CommandText = "SELECT * FROM AccountType"
        da2 = New SqlCeDataAdapter(cmd)
        da2.Fill(dtAcctType)

        txtAcctName.DataBindings.Add("Text", dtAcct, "AcctName")
        txtPhone.DataBindings.Add("Text", dtAcct, "AcctPh")
        dtOpenDate.DataBindings.Add("Text", dtAcct, "AcctOpenDate")
        dtCloseDate.DataBindings.Add("Text", dtAcct, "AcctCloseDate")
        chkActive.DataBindings.Add("checked", dtAcct, "AcctActive")
        txtWeb.DataBindings.Add("Text", dtAcct, "AcctWebAddress")
        txtID.DataBindings.Add("Text", dtAcct, "AcctWebID")
        txtPW.DataBindings.Add("Text", dtAcct, "AccteWebPWord")
        txt1.DataBindings.Add("Text", dtAcct, "AcctBillAddr1")
        txt2.DataBindings.Add("Text", dtAcct, "AcctBillAddr2")
        txtCity.DataBindings.Add("Text", dtAcct, "AcctBillCity")
        txtSt.DataBindings.Add("Text", dtAcct, "AcctBillSt")
        txtZip.DataBindings.Add("Text", dtAcct, "AcctBillZip")
        cboType.DataSource = dtAcctType
        cboType.DisplayMember = "AcctType"
        cboType.ValueMember = "AcctTypeID"
        cboType.DataBindings.Add("SelectedValue", dtAcct, "AcctTypeID")


    End Sub


    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Try
            conn.Open()
        Catch
        End Try

        Dim cmd1 As String = …
cpopham 0 Junior Poster in Training

Okay, it has been a while since I have used Vb .Net and I have now downloaed and installed Vb .net 8 express. I have setup a relational database in sql compact. I am trying to get a compbo box that will show values from one table and when an item is selected store the item ID value in another table, but when you go through the records I want the text of the selected item to show in the combobox. This is similar to the way it works in MS access 2002-2003. I see the databings and also the datasource, and display member, but how can I get the combo box to do what I need? Please help...

cpopham 0 Junior Poster in Training

Generally a joint table should contain the names of both tables, such as ACCOUNT_CUSTOMER.

cpopham 0 Junior Poster in Training

There are several apps depending on the ver of access that you are using. Do a search on google and you will find several.

cpopham 0 Junior Poster in Training

You can also use queries to calculate fields from several tables, perform regular calculations, etc. You can also perform calculations inside a report based on grouping and that may be easier, but I need to know a little more about what the calculation is and the underlying table structure.

cpopham 0 Junior Poster in Training

Try looking at the InStr function examples on this page:

http://office.microsoft.com/en-us/access/HA010547271033.aspx

Chester

cpopham 0 Junior Poster in Training

Okay, first things first. What type of calculation are you attempting to do in the query? Are you calculating across multiple fields? Please provide a little more information about the calculation and the table structure if any the calculated fields are based upon.

Chester

cpopham 0 Junior Poster in Training

Calculated fields in forms only exit in the form. You cannot query a calculated field from a form. You can regenerate the calculations in a query based on the same table the form is base on.

Chester

I have a field on a form which is calculated (A minus B). It displays properly on the form with the correct answer. I can't figure out how to get it to pull into a query? My query is pulling any record with that field criteria >0 and no records come up when I run the query altough there should be several with a positive result in the field.

I am a newbie, so please bear with me . . . . thanks in advance for any help.

cpopham 0 Junior Poster in Training

You could use a variable. Put a form level variable that is set to the current date on form load and assigns the variable date to the field. Then on the field on the BeforeUpdate assign the date that is entered from the field to the form level date. In the OnCurrent event set the field to the form level variable.

There may be easier ways, but I just through that together.

Chester

cpopham 0 Junior Poster in Training

I am building a website. I have a database table that contains tips. The tips table is simple, it contains an ID column and a Tip column. I have a datareader to read the table and fill a datatable, however, I would rather have the datareader create a cached xml document. I know how to read an xml file into cache with code, but I would like for the datareader to create a cached xml document.

Does anyone know how to accomplish this task?

Thanks, Chester

cpopham 0 Junior Poster in Training

Here is one that is stumping me.

I have an Access 2000 database backend. It got corrupted. It is a large database. I compacted and repaired it and a record came up corrupted. There was a compact error table created that has a binary column in it. The binary column points to a bookmark that tells which row was corrupted. I am trying use vb .net to retrieve that row using the binary column to show me which record is corrupted, however, I cannot get it to work right. I have found VBA for Access code that does something similar, but I need it in VB .net. Here is the VBA code that I have:

Sub main() 
    On Error GoTo ErrorHandler 
    Dim db As DAO.Database, vBookMark As Variant, _ 
      rsMSysCompactError As DAO.Recordset, strErrorTable As String, _ 
      rsErrorTable As DAO.Recordset, fldErrorField As DAO.Field, _ 
      strSQLSEL As String, strColumnValue As Variant, _ 
      qdTemp As QueryDef, strSQLINS As String, intLoop As Integer, _ 
      lngTableNameLength As Long, _ 
      colErrorCollection As New Collection, intErrorCount As Integer 

    Set db = CurrentDb() 
    ' Walk through the MSysCompactError table to find rows that reflect 
    ' lost data values. 
    Set rsMSysCompactError = db.OpenRecordset("SELECT * FROM MSysCompactError WHERE ErrorRecId IS NOT NULL", dbOpenDynaset) 
    intErrorCount = 0 
    While Not rsMSysCompactError.EOF 
        ' Get the name of the table that had column data missing. 
        strErrorTable = rsMSysCompactError!ErrorTable 
        ' Check to see that tablename is not greater than 48 characters 
        ' to stay under 64 character tablename limit. 
        lngTableNameLength = Len(strErrorTable) 
        If …
cpopham 0 Junior Poster in Training

You will need to use a submain procedure. Create a splash screen form and create a timer event. Set the timer to how long you want the splash screen to stay visible. On you submain, set your splashscreen to open first and then yoru main form to open second. When the timer close the splash screen, the sub main will open your next form.
Please see this article for more information:

http://www.vbcity.com/forums/topic.asp?tid=36074

cpopham 0 Junior Poster in Training

So I should just develop a traditional database app and not go ASP .NET. The reason I need to encrypt is because my app will have financial information and items such as social security numbers. So I would rather error on the side of over protection than under protetion. There are too many stories out now about peoples personal info being hacked and compromised.

However, it will be difficult developing this in a traditional windows app because the users will be all over the place. My reasoning for developing a web app instead of a windows app.

Catach 22 enough seucirty people will not want to use it, but not enough and there is a possibility of compromise which can not happen.

Chester

cpopham 0 Junior Poster in Training

Well, I was thinking of encrypting the fields themselves, possibly using symetric encryption...

Chester

cpopham 0 Junior Poster in Training

Yeah, I was thinking about just hashing the password. But my only problem is the web hosting company DB admins can see whatever the database contains or create a user that can do it. I want to somehow encrypt the actual data in the DB so my clients xan login and see it but now one else can. I have not came up with a way to do that yet and still use a broswer interface.

Chester

cpopham 0 Junior Poster in Training

I am wanting to know what ways to attempt to do this. I want to set up an ASP >NET database service. The database (MySQL) will be hosted by a web hosting company which mya not be secure. I am thinking the best way to store clients' data would be to encrypt it, but how would I accomplish this? I can not store the encryption in the database and since it will be browser based, I do not want to store the keys on the client's PC. I want them to login and have access to their data, but do not want anyone else to have access to it and make it very secure. What would be the best way to do this?

Thanks, Chester

cpopham 0 Junior Poster in Training

Yes, ING is good. I have had a savings account with them for quite sometime now. However, their turnarounds are really slow. I have had it take up to a week and a half to get my money deposited into my checking account from ING. Their minimum is 3 days, but that is only an estimate. So, if you need your money in a hurry, don't tie it up in ING. They are paying about 3.75% right now on savings which is really good compared to my local bank. So if they are slow, at least you get more interest!

Chester

cpopham 0 Junior Poster in Training

How rae your tables setup in the database backend? In a accounting / banking type of application, you should use a transcation table, which will be a bridge entity. I would put a time stamp in the transaction table that would show when the transaction was made. If you use a tranaction table, then querying this table to generate a report would be easy.

Chester

Hi I m a final yr comp Engg student.
I m working on .NET,i m usin mssql with ASP.NET,VB.NET for creatin online banking site.I hv a problem:

Hw i can record the transaction made by client for report generation.
shal i use database for report generation?if yes then hw?
otherwise tel me proper way to generate report.

Plz giv me detailed answer.

thnx in advance

cpopham 0 Junior Poster in Training

Well, it depends on what you would like to do. The main thing the datatier should do is keep the data access seperate from the rest of the application. I most often use a module and then pass a dataview between the layers. I somtimes will pass a dataset. It most often depends on what I wnt to do. The data access layer / module will also make your code easier to follow as the data access layer is the central point for accessing the database.

Chester

cpopham 0 Junior Poster in Training

Are you setting the m_strExpDate vairable to the date the user selected on the calender?

Chester

HI,

Here is the code u asked for,

Private Sub cboExpiryDate_SelectedIndexChanged(ByVal sender As_ System.Object, ByVal e As System.EventArgs) Handles_ cboExpiryDate.SelectedIndexChanged

If cboExpiryDate.Text = "1 Month" Then
'do something
elseif cboExpiryDate.Text = "2 Month" Then
'do something
elseif cboExpiryDate.Text = "3 Month" Then
'do something
ElseIf cboExpiryDate.Text = "Other" Then
'Open a calender and receive the date in a variable m_strExpDate
' i was trying to do as below but wit no results.
cboExpiryDate.Text =m_strExpDate

End Sub

cpopham 0 Junior Poster in Training

If I understand what you are asking, then the database backend will take care of the updates and you would be able to see the changes immediately no matter where you are connecting from.

Now is this Access backend going to be on a web server or in some other location? Either way, if you are using the .Net framework, you can manage multiple connections to the database backend without much trouble. Are the three locations already networked together using a WAN? If not, you may need to set up a VPN or something along those lines.

Chester

cpopham 0 Junior Poster in Training

Why are you needing mysql installed on all of the local machines. This would create many servers, which can be a security risk. A major point of having a database server is to bring all of the data to a central location.

Chester

cpopham 0 Junior Poster in Training

If someone can gain access to your computers memory where the session variables reside, you have a lot more to be concerned about than the session variables. Now in asp where you are going over the internet, I can see where this would be a concern.

Chester

cpopham 0 Junior Poster in Training

Okay this is a good one I believe. In a dataset, you can create single relations (ParentTable.PrimaryKey to ChildTable.ForignKey) using the dataset.relations.add method. You can use a string variable something like this:

Dataset.Relations.Add("relationName",Dataset.ParentTable.columns(strParentKey),dataset.ChildTable.columns(strchildForeignKey)

This method works fine for single to single keys generated dynamically using schema info.

Now if there are two or more keys involved to make up the primary key, it starts getting a little tricky. If you know all of the columns ahead of time, you can hard code them in. However, I am creating an independant procedure that will generate the relations dynamically.

So I will not know ahead of time is there is a single column primary key or a ten(10) column primary key involved in the relations, but I need to be able to add the columns dynamically to the relations columns collection to account for all of these situations.

Anybody have any ideas?

Thanks, Chester

cpopham 0 Junior Poster in Training

I have a general user account which has all of thr rights and priveleges that I wan all of my users to have. Is there an easy way to copy this account to create new users with the same priveleges?

Thanks, Chester

cpopham 0 Junior Poster in Training

Okay, I have been working with MySql for quite a while on Windows and can generally do what I need. I use Navicat to do a lot of the work because it is a lot faster than working it from a prompt.

Anyway, I got permission to set up a linux box and I chose to mandrake on it. I downloaded MySql 5.0 both Server and Client RPMs and they installed fine. I pulled up a prompt and was right in when I typed mysql at the prompt. So I know that mysql is up and running and I can get in from local host without a password.

At the MYSql prompt, I have tried:
GRANT ALL PRIVILEGES ON *.* TO MyUser@% IDENTIFIED BY 'myPass';

And I get a SQL error every time. Anyone have any ideas?

Thanks, Chester

cpopham 0 Junior Poster in Training

I have created a program to monitor a network folder for file additions based on this link: http://abstractvb.com/code.asp?A=1081

It works fine on my local drive, but does not work for a Novell Server. Does anyone have any ideas of how to get it to monitor a Novell folder? If not, how about a way to scan a Novell server folder for new files like every hour on a timer event?

Thanks,
Chester

cpopham 0 Junior Poster in Training

This is pertaining to executables. If you put an executable on the network and then allow the users to execute it from the network drive, then allow your users to execute it, you would have downgrade your network security. This would be serious problem because then malicious code could be ran the same way. That is why your network admin dept will not allow the programmers to install it this way.

Chester

cpopham 0 Junior Poster in Training

I am a student and am developing my knowledge of MySQL and am practicing using it as a backend for some of my apps. I can run MySql on my laptop (Windows XP Pro) and use my apps referring to the local host. We have a wireless network in our home and I am about to get my big compuer back up and running. When I get it up, it will have Windows XP Pro on it. I am planning on installing MySql on it and practice using it more in a network environment. Now my question(s) are: How do I "share" MySQL from my main computer so that my apps can access it and instead of using localhost to get to it how will I refer to it?

Thanks,

Chester

cpopham 0 Junior Poster in Training

Some public holidays vary from state to state and some public holidays are celebrated at different times. For example WV had the Monday off following New Year's and GA had the Friday off before New Years. Now are the weekends work days or are they non work days. Also, what day of the week does your work week /pay period / leave period start and end?

Chester

cpopham 0 Junior Poster in Training

Microsoft will be releasing at least three "flavors" of the new Visual Studio Suite. One will be targeted at enterprise development, another version will be targeted at smaller firms and individuals and then they will have one that targets Microsoft Office and should only work with Office. The prices for each suite will vary. By the time of the rollout they probably will have more "flavors" available.

Chester

cpopham 0 Junior Poster in Training

For web development, you can also go to aspfree.com and download webmatrix. It works pretty well and is open source. Microsoft is adding ome nice features to try and get developers to lay down the money to go up to 2005 from 2003.

Chester

cpopham 0 Junior Poster in Training

You can Purchase Visul Studio .Net 2003 Professional Educational and it has Crystl Reports .net, I also have created custom controls on my educational version of Visual Studio. I just can not use it for commercial use. As long a I use it for personal and learing use, it is fine. Now even the comercial version of VB .Net standlone does not have Crystal. You are talking about the differences between VB standalone and Visual Studio. Now granted the standalone of VB comercial is about $150 verses the educational stand alone of $49 and VS Suite comercial is about $1000 and the educational is $150. Also in the suite you can code one module in C#, J# or whatever and they will work together just fine. Yes the standalone versions of the .net languages are chocked down, but then people want more out of a suite than a standalone.

Chester

cpopham 0 Junior Poster in Training

When I add the tool to a particular solution, it will stay in that solution, but if I start a new solution, all of my tools that I have added disappear in the new solution. I make a new tab named myTools and add them under that tab.

Chester

cpopham 0 Junior Poster in Training

Through the customize option,,,

Chester

cpopham 0 Junior Poster in Training

Okay, you can just install Access on your computer. Yes XP will operate faster than 98 when you have the .net 1.1 framework installed, but you do not have to have office 2003 installed. We have Windows XP with .net framework 1.1 installed and using backend Access 2000. The .net framework is independant of Office. VB .net can be used with many db servers and it does not care what the backend database is. If you want optimal speed, you should use XP and then download the latest .net framework from Microsoft.

Chester

cpopham 0 Junior Poster in Training

You can set up one sub and then set it to handle all of the events such as on lostfocus on mouseleave, etc. Then you could assign the row value to a variable possibly...

Chester

cpopham 0 Junior Poster in Training

You can get REALbasic for free ($99.95 value, no strings attached) from http://www.realbasic.com/vb in a special promotion the company is offering, good through March 31, 2005.

But is Realbasic .net framework compatible?

cpopham 0 Junior Poster in Training

Does anyone know how to add a new user created tool to the toolbox permanently? Everytime I start a knew solution, I have to go and add my customized tools back into the tool box. I would like to add the custom tools once and then they be there everytime I start a new solution. Anyone know how?

Chester

cpopham 0 Junior Poster in Training

Yes there are several license restrictions. You can not use the educational version for comercial use or to make a profit at all. No you do not have to be a student, someone even mentioned that you can buy the educational versions at amazon or ebay. It is a good way to help people learn the products, especially students who do not have a lot of discretionary income.
Chester

cpopham 0 Junior Poster in Training

What database are you using? You can usually set a field size limit when you design you table in most DBMSs.

Chester

cpopham 0 Junior Poster in Training

If you just learning, the educational edition of he suite is a cheaper alternative to the full license. There are items and things that you can do with the suite that are very limited or nonexistent in the individual languages. This is Microsoft's way of attempting to get people to invest in the more expensive suite than in the individual languages.

Chester

cpopham 0 Junior Poster in Training

I am not sure, but I think SP3 may change the core from 10 to 11. This may be the problem. Check to see what Office and Word Objects version you are referencing.

Chester

cpopham 0 Junior Poster in Training

Glad it worked for you...

Chester

cpopham 0 Junior Poster in Training

There are more ways than one to accomplish what you want....

Chester

cpopham 0 Junior Poster in Training

Can you describe the "sub-main procedure" to me? Sorry, I'm a noob.

Right Click on your project and the click Add New Item
Click Module
Name your Module
Open the new Module
Between the Module Header and Footer, type Sub Main() and enter
Now enter your code.

On the Solution Explorer right click and click on your settings, under startup, click Sub Main.

Hope this helps.

Chester

cpopham 0 Junior Poster in Training

expression.length will give you the number of characters.

Dim intLetCount as integer

intLetCount = me.textbox.length

If intLetCount < 160 Then
     Do Something
Else
     Do Something Else
End If

Hope that helps.

Chester

cpopham 0 Junior Poster in Training

First Question:
Yes you can do that. You would need to use the sub main procedure. The sub main is usually used for things like a splash screen, but you could use it to start two seperate threads.

Second Question:
You would need to import file IO, but yes you can delete a file or files.

Chester