Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Invalid argument error with creatingdatabase in vb6

Posted on 2008-10-04
2
Medium Priority
?
231 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 143

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 200 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Suggested Courses

721 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