English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

1. im using an ODBC (Data connector)......to connect my DB(MS access 2000) with VB6.0

2. im having a string variable "tab" to assign a table name value(im having many tables..and by using an if loop im assigning any of the tables to this variable tab")

3. now this code shows error to open a recordset....
(i.e. i want to connect all the fields(*) from that string variable-"tab" which contains the table name"

the code is :

Set rs = db.OpenRecordset("select * from "& tab&" ")....

This is the way i hope. but it dosen't works....says that there is some syntax error.......

Please help Me...i'll be very much greatfull to You.............

Thank You............

2007-09-08 21:17:00 · 2 answers · asked by sant t 1 in Computers & Internet Programming & Design

2 answers

Your code got chopped off by Yahoo.....

Try the following syntax, for your SQL string, note the semicolon terminator and the use of the table name with the asterisk.

SELECT Table.* FROM Table;

Also check your connection to the database, I believe that the open recordset is expecting a connection string. An error here will also cause a problem. Try making a simple subroutine which established a connection to the db and opens the DB. Get that to work first before trying to open a table and it will help isolate any problems

2007-09-09 00:23:40 · answer #1 · answered by MarkG 7 · 0 1

Or else you may contact a VB expert. Check websites like http://oktutorial.com/

2007-09-09 09:11:20 · answer #2 · answered by Anonymous · 0 0

fedest.com, questions and answers