Click here to Skip to main content
15,887,952 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: SMTP Mails - working in one computer not with other computer Pin
nlarson1117-Jun-09 6:21
nlarson1117-Jun-09 6:21 
GeneralRe: SMTP Mails - working in one computer not with other computer Pin
Paramu197317-Jun-09 19:16
Paramu197317-Jun-09 19:16 
GeneralRe: SMTP Mails - working in one computer not with other computer Pin
Rajesh Anuhya17-Jun-09 20:33
professionalRajesh Anuhya17-Jun-09 20:33 
QuestionUsing 'SetParent' function in VB 2008 Pin
Filippo197417-Jun-09 2:31
Filippo197417-Jun-09 2:31 
AnswerRe: Using 'SetParent' function in VB 2008 Pin
nlarson1117-Jun-09 3:33
nlarson1117-Jun-09 3:33 
GeneralRe: Using 'SetParent' function in VB 2008 Pin
Filippo197417-Jun-09 3:55
Filippo197417-Jun-09 3:55 
QuestionPropertyGrid image Selection while Property is ReadOnly Problem Pin
VB 8.017-Jun-09 2:04
VB 8.017-Jun-09 2:04 
QuestionIssue while creating tables in ms access using VB.NET ADOX [modified] Pin
sivakumar.mariappan17-Jun-09 0:32
sivakumar.mariappan17-Jun-09 0:32 
Hi,

While trying to create a group of tables in msaccess using VB.NET ADOX, i am facing the error "System.Runtime.InteropServices.COMException...at ADOX.columns.Append(Object item, DatatypeEnum Type, Int32 DefinedSize)".

The coding is given below..

Public Function CreateAccessDatabaseandtables( _
ByVal DatabaseFullPath As String) As Boolean
Dim bAns As Boolean
Dim con As New ADODB.Connection
Dim cat As New ADOX.Catalog()
Dim ADOXtable As New ADOX.Table
Dim ADOXindex As New ADOX.Index

Try
Dim sCreateString As String
sCreateString = _
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & _
DatabaseFullPath
cat.Create(sCreateString)

bAns = True

'cat.ActiveConnection = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & DatabaseFullPath
con.Open("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & DatabaseFullPath)

'name table, append fields to table
ADOXtable.Name = "ACN_CHARX"
ADOXtable.Columns.Append("LOGICAL_DB_NAME", ADOX.DataTypeEnum.adVarWChar, 32)
ADOXtable.Columns.Append("DIM_NAME", ADOX.DataTypeEnum.adVarWChar, 32)
ADOXtable.Columns.Append("CHARX_NAME", ADOX.DataTypeEnum.adVarWChar, 128)
ADOXtable.Columns.Append("CHARX_SEQ", ADOX.DataTypeEnum.adInteger)
ADOXtable.Columns.Append("CHARX_TYPE", ADOX.DataTypeEnum.adVarWChar, 1)
ADOXtable.Columns.Append("BITMAP", ADOX.DataTypeEnum.adInteger)
'append tables to database
cat.Tables.Append(ADOXtable)

ADOXtable.Name = "ACN_CHARX_INSTANCE"
ADOXtable.Columns.Append("LOGICAL_DB_NAME", ADOX.DataTypeEnum.adVarWChar, 32)
ADOXtable.Columns.Append("DIM_NAME", ADOX.DataTypeEnum.adVarWChar, 32)
ADOXtable.Columns.Append("CHARX_NAME", ADOX.DataTypeEnum.adVarWChar, 128)
ADOXtable.Columns.Append("CHARX_TABLE", ADOX.DataTypeEnum.adVarWChar, 128)
ADOXtable.Columns.Append("CHARX_VALUE_COL", ADOX.DataTypeEnum.adVarWChar, 128)
ADOXtable.Columns.Append("VALUES_UNIQUE", ADOX.DataTypeEnum.adInteger)
ADOXtable.Columns.Append("CHARX_ORDER_COL", ADOX.DataTypeEnum.adVarWChar, 128)
ADOXtable.Columns.Append("CHARX_ORDER", ADOX.DataTypeEnum.adInteger)
ADOXtable.Columns.Append("CHARX_NUMERIC_COL", ADOX.DataTypeEnum.adVarWChar, 128)
ADOXtable.Columns.Append("BITMAP_COL", ADOX.DataTypeEnum.adVarWChar, 128)
'append tables to database
cat.Tables.Append(ADOXtable)

Catch Excep As System.Runtime.InteropServices.COMException
bAns = False
MessageBox.Show(Excep.ToString)
Finally
cat = Nothing
End Try
Return bAns
End Function

Please help me to rectify this error...

Thanks,
Sivakumar.M.

modified on Wednesday, June 17, 2009 6:45 AM

AnswerRe: Issue while creating tables in ms access using VB.NET ADOX Pin
Johan Hakkesteegt17-Jun-09 0:47
Johan Hakkesteegt17-Jun-09 0:47 
GeneralRe: Issue while creating tables in ms access using VB.NET ADOX Pin
sivakumar.mariappan17-Jun-09 1:15
sivakumar.mariappan17-Jun-09 1:15 
AnswerRe: Issue while creating tables in ms access using VB.NET ADOX Pin
Ashfield17-Jun-09 1:25
Ashfield17-Jun-09 1:25 
GeneralRe: Issue while creating tables in ms access using VB.NET ADOX Pin
sivakumar.mariappan17-Jun-09 3:49
sivakumar.mariappan17-Jun-09 3:49 
GeneralRe: Issue while creating tables in ms access using VB.NET ADOX Pin
Ashfield17-Jun-09 8:57
Ashfield17-Jun-09 8:57 
QuestionRead the Excel upto used range Pin
Member 402761716-Jun-09 21:36
Member 402761716-Jun-09 21:36 
AnswerRe: Read the Excel upto used range Pin
Johan Hakkesteegt16-Jun-09 21:54
Johan Hakkesteegt16-Jun-09 21:54 
AnswerRe: Read the Excel upto used range Pin
Ebube17-Jun-09 0:09
Ebube17-Jun-09 0:09 
QuestionHow to identify the Users Network Credentials? [modified] Pin
Paramu197316-Jun-09 21:20
Paramu197316-Jun-09 21:20 
AnswerRe: How to identify the Users Network Credentials? Pin
Johan Hakkesteegt16-Jun-09 21:49
Johan Hakkesteegt16-Jun-09 21:49 
QuestionChange the size od MDI container in the parent form Pin
sohaib_a16-Jun-09 21:06
sohaib_a16-Jun-09 21:06 
AnswerRe: Change the size od MDI container in the parent form Pin
Dave Kreskowiak17-Jun-09 7:57
mveDave Kreskowiak17-Jun-09 7:57 
GeneralRe: Change the size od MDI container in the parent form Pin
sohaib_a17-Jun-09 19:20
sohaib_a17-Jun-09 19:20 
GeneralRe: Change the size od MDI container in the parent form Pin
Dave Kreskowiak18-Jun-09 11:23
mveDave Kreskowiak18-Jun-09 11:23 
QuestionUnistall from vb.net Pin
Mithun.Shitole16-Jun-09 20:21
Mithun.Shitole16-Jun-09 20:21 
AnswerRe: Unistall from vb.net Pin
dan!sh 16-Jun-09 21:52
professional dan!sh 16-Jun-09 21:52 
GeneralRe: Unistall from vb.net Pin
Mithun.Shitole17-Jun-09 1:53
Mithun.Shitole17-Jun-09 1:53 

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.