Solved

Invalid argument error with creatingdatabase in vb6

Posted on 2008-10-04
2
218 Views
Last Modified: 2012-05-05
Hello,

For some reason I get an invalid argument error with attached code or attached pic.
Error line is marked with : ERROR LINE

Could someone help me out?
Regards,
Dennis
Function Create_Database()
 
Dim dbnewDB As Database
Dim tdnewtable As tabledef
Dim fld As field
Dim idx As Index
 
 
Set dbnewDB = createdatabase("c:\structure\Dennis.mdb", dblanggeneral)
Set tdnewtable = New tabledef
Set fld = tdnewtable.createfield("Title", dbtext, 20)
tdnewtable.fields.append fld
Set fld = tdnewtable.createfield("Open", dbMemo, 20)
tdnewtable.fields.append fld
Set fld = tdnewtable.createfield("High", dbMemo, 20)
tdnewtable.fields.append fld
Set fld = tdnewtable.createfield("Low", dbMemo, 20)
tdnewtable.fields.append fld
Set fld = tdnewtable.createfield("Close", dbMemo, 20)
tdnewtable.fields.append fld
Set fld = tdnewtable.createfield("Signal_1", dbMemo, 20)
tdnewtable.fields.append fld
Set fld = tdnewtable.createfield("Equity_1", dbMemo, 20)
tdnewtable.fields.append fld
Set idx = tdnewtable.createindex
With idx
.Name = "idxTitle"
.fields.append.createfield ("Title") 'ERROR LINE
 
End With
tdnewtable.indexes.append idx
tdnewtable.Name = "tblcollection"
dbnewDB.tabledefs.append tdnewtable
 
Set dbnewDB = Nothing
 
 
 
End Function

Open in new window

invalid.jpg
0
Comment
Question by:Schuttend
2 Comments
 
LVL 142

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 50 total points
ID: 22644125
change:

.fields.append.createfield ("Title")

into (not the SPACE between append and .createfield:

.fields.append  .createfield ("Title")  
0
 

Author Closing Comment

by:Schuttend
ID: 31503054
Thanks for the great help!

Regards,
Dennis
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

813 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now