Recent content by desmond

  1. D

    How to add Cancel button to threaded 'Please Wait' Form

    I am trying to build an application that exports a datagridview to excel. That bit's easy, but I wanted a 'please wait with animated gif' to display whilst it does. After a lot of trying different things, I eventually got that to work by wrapping the thread in a class. However, I would now...
  2. D

    Export datagridview to excel and format font

    I have a process in VB.net that writes out an XML file. However, I am unable to format the font. Does anyone know how to update the font to ‘courier new’? I have tried adding: fs.WriteLine(" <ss:Font FontName=""Courier New"" ss:size=""10"" ss:Bold=""1""/>") to my code, but it doesn’t seem to...
  3. D

    How to format field from XLS file

    I have a process that writes an XML file, and when I open this file in Excel, it opens as expected. However, I cannot get the font to format. Can anyone help? This works: <?xml version="1.0"?> <?mso-application progid="Excel.Sheet"?> <ss:Workbook xmlns:ss="urn:schemas-microsoft-com...
  4. D

    Update Access column property to checkbox from VB.NET

    Well I got this to work for anyone who's having the same issue. I don't understand why this small difference worked, but it did: Dim dbe As Microsoft.Office.Interop.Access.Dao.DBEngine Dim dbs As Microsoft.Office.Interop.Access.Dao.Database Dim fld As dao.Field Dim prp As dao.Property dbe =...
  5. D

    Erratic results when updating properties to more than 1 table

    I am successfully updating the properties of an access database column, but if I try to update the same properties of another table immediately after, I get erratic results. Sometimes the result says 'Record deleted'; sometimes the result says 'cannot append. an object with that name already...
  6. D

    Access SQL Summary / Count Query

    MStef, you are a legend.
  7. D

    Access SQL Summary / Count Query

    I am new to Access SQL and wondered if it is possible to summarise / count by field? e.g. If I have a table as follows: Post_Cd Status Type 1234 A1 Z 1234 A1 Y 1234 A1 Z 1234 A1 Z 1234 A2 Z 1234 A2 Y 1234 A1 Y...
  8. D

    Update Access column property to checkbox from VB.NET

    I added a COM reference to Microsoft Office 12.0 Object Library, and Microsoft Office 12.0 Access Database Engine Object Library 12.0. It made no difference at all. It still fails on this line (unrecognizable database format): dbs = dbe.OpenDatabase("C:\TestDB.accdb") After scouring the...
  9. D

    Update Access column property to checkbox from VB.NET

    Yes, and I can also open from the prior bit of code: con.ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\TestDB.accdb;Persist Security Info=False;" sql = "ALTER TABLE TestName ADD COLUMN [TestFlag] YesNo" Cmd = New OleDbCommand(sql, con) con.Open() ObjCmd = New...
  10. D

    Update Access column property to checkbox from VB.NET

    Hi Lagbolt - thanks for the quick response. I already did a search and added this as a reference, but I still get the same issue. My code now looks like this: Dim dbe As New dao.DBEngine Dim dbs As dao.Database Dim fld As dao.Field Dim prp As dao.Property dbs =...
  11. D

    Update Access column property to checkbox from VB.NET

    Thanks for the response Lagbolt. Because I'm using Access 2007, I cannot use .mdb. And if I simply change this to .accdb, it doesn't work (unrecognized database format). I've even tried it with "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=..." and it doesn't work. Any ideas?
  12. D

    Update Access column property to checkbox from VB.NET

    I tried the following code: Dim fld As dao.Field Dim tdf As dao.TableDef Dim prp As dao.Property Dim dbE As dao.DBEngine Dim dbI As SqlDbType tdf = dbE(0)(0).TableDefs("TestName") fld = tdf.Fields("TestFlag") prp = fld.CreateProperty("DisplayControl", dbI, 106) fld.Properties.Append(prp)...
  13. D

    Update Access column property to checkbox from VB.NET

    Does anyone know how I can update the column properties in Access from VB.NET? I am trying to make the column a check-box after I create the column. Here is my code: con.ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Test.accdb;Persist Security Info=False;" sql =...
  14. D

    Textfile objreader readline is missing some data

    Thanks David, this is a good bit of advice, but didn't solve the problem. I eventually found out it was due to unix scripting - dos to unix - special characters (e.g. carriage return / tab etc) hadn't been catered for.
  15. D

    Update access textbox from VB.net

    Does anyone know how to update a textbox value on an Access form from VB.NET? Dim oAccess As New Access.Application oAccess.OpenCurrentDatabase(filepath:="C:\TestDB.accde", Exclusive:=True) oAccess.Visible = False...
Top Bottom