Click here to Skip to main content
15,917,176 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
AnswerRe: where is Exactly used Delegate Pin
Luc Pattyn22-Jul-08 2:48
sitebuilderLuc Pattyn22-Jul-08 2:48 
AnswerRe: where is Exactly used Delegate Pin
Bassam Saoud25-Jul-08 11:19
Bassam Saoud25-Jul-08 11:19 
AnswerRe: where is Exactly used Delegate Pin
Paul Conrad25-Jul-08 16:39
professionalPaul Conrad25-Jul-08 16:39 
AnswerRe: where is Exactly used Delegate Pin
#realJSOP26-Jul-08 0:58
professional#realJSOP26-Jul-08 0:58 
GeneralRe: where is Exactly used Delegate Pin
Paul Conrad27-Jul-08 13:36
professionalPaul Conrad27-Jul-08 13:36 
QuestionError making an entry to the event log [modified] Pin
Vipul Mehta21-Jul-08 20:01
Vipul Mehta21-Jul-08 20:01 
AnswerRe: Error making an entry to the event log Pin
leppie24-Jul-08 4:39
leppie24-Jul-08 4:39 
QuestionWorking with access through vb.net Pin
Steve R Adams20-Jul-08 9:20
Steve R Adams20-Jul-08 9:20 
Hi all - maybe somebody here can help me with this.

My Goal : To import some very large spreadsheets directly into access without using a dataset and writting line by line. The main problem is that I have a few hundred users and they will constantly be uploading LARGE files in different formats which I need to place into various access databases. If I use the INSERT INTO method it takes FOREVER but if I run the command directly from access, a file with 30000 records takes less than 4 seconds.

Option 1
(This runs a module that was previously set up (which Im trying to avoid using) but physically opens the database)


Dim oAccess As New Access.ApplicationClass
Dim test As Boolean
oAccess.Visible = False
oAccess.OpenCurrentDatabase(ConfigurationManager.AppSettings("physicalpathtomembersdirectory") & memid & "\addressbook.mdb", False)
test = oAccess.Run("ImportSpreadsheet", FileName, HasRows)
oAccess.CloseCurrentDatabase()

Option 2
(The idea of using this was that I could create a macro 'on the fly' and then run it - It doesn't work this way either)

Dim bAns As Boolean
Dim strsql As String
Dim cat As New ADOX.Catalog()

Try
Dim sCreateString As String
sCreateString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & DBFileName

Dim a As Object
a = "DoCmd.TransferSpreadsheet(Access.AcDataTransferType.acImport, Access.AcSpreadSheetType.acSpreadsheetTypeExcel9, 'group', " & ImportFileName & "," & HasRows & ")"
cat.Procedures.Append("import", a)
bAns = True

Catch Excep As System.Runtime.InteropServices.COMException
bAns = False
'do whatever else you need to do here, log,
'msgbox etc.
Finally
cat = Nothing
End Try
Return bAns

Option 3
(This one doesn't work because a oledb command object will only run a valid sql statement)
Dim Connectionstring As String
Connectionstring = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & DBFileName & ";Persist Security Info=False;"

Dim mycon As New OleDb.OleDbConnection(Connectionstring)
Dim str As String = "DoCmd.TransferSpreadsheet(Access.AcDataTransferType.acImport, Access.AcSpreadSheetType.acSpreadsheetTypeExcel9, 'group', " & ImportFileName & "," & HasRows & ")"

Dim mycmd As New OleDb.OleDbCommand
mycmd.CommandText = str
mycmd.Connection = mycon
mycon.Open()
mycmd.ExecuteNonQuery()
mycon.Close()
Return True

Any suggestions?
Thanks
Steve
QuestionRe: Working with access through vb.net Pin
Paul Conrad21-Jul-08 8:55
professionalPaul Conrad21-Jul-08 8:55 
Questionneed your help for my project..customizing application in vb.NET Pin
emmegor20-Jul-08 4:29
emmegor20-Jul-08 4:29 
AnswerRe: need your help for my project..customizing application in vb.NET Pin
Ashfield25-Jul-08 9:07
Ashfield25-Jul-08 9:07 
QuestionHttpWebRequest time out in multi-thread application Pin
miemie200818-Jul-08 17:37
miemie200818-Jul-08 17:37 
QuestionRe: HttpWebRequest time out in multi-thread application Pin
Mark Salsbery20-Jul-08 8:49
Mark Salsbery20-Jul-08 8:49 
Question.NET Application Debugging Tips Pin
Rob Caldecott18-Jul-08 4:06
Rob Caldecott18-Jul-08 4:06 
AnswerRe: .NET Application Debugging Tips Pin
led mike18-Jul-08 5:28
led mike18-Jul-08 5:28 
QuestionDisabling selection of CheckedListbox problem Pin
kensai18-Jul-08 1:06
kensai18-Jul-08 1:06 
AnswerRe: Disabling selection of CheckedListbox problem Pin
kensai18-Jul-08 1:43
kensai18-Jul-08 1:43 
QuestionWindows Service (.NET) and MFC Pin
xuesyuan17-Jul-08 10:50
xuesyuan17-Jul-08 10:50 
AnswerRe: Windows Service (.NET) and MFC Pin
Mark Salsbery17-Jul-08 11:10
Mark Salsbery17-Jul-08 11:10 
GeneralRe: Windows Service (.NET) and MFC Pin
xuesyuan17-Jul-08 12:03
xuesyuan17-Jul-08 12:03 
QuestionCRM3.0 Callout Pin
April Unni17-Jul-08 8:22
April Unni17-Jul-08 8:22 
AnswerCross Post Pin
Pete O'Hanlon17-Jul-08 10:59
mvePete O'Hanlon17-Jul-08 10:59 
GeneralRe: Cross Post PinPopular
led mike17-Jul-08 18:59
led mike17-Jul-08 18:59 
GeneralRe: Cross Post Pin
Pete O'Hanlon18-Jul-08 3:53
mvePete O'Hanlon18-Jul-08 3:53 
GeneralRe: Cross Post Pin
led mike18-Jul-08 6:08
led mike18-Jul-08 6:08 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.