473,569 Members | 2,844 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

help! ado connection string variable

link
71 New Member
hi everyone,

please help me on how to put my data path in variable. I'm using ADO and my database is visual foxpro 6 and I'm using visual basic 6.

this is my connection string:
Provider=VFPOLE DB.1;Data Source=D:\2007\ 01\18;Mode=Read ;Password="";Co llating Sequence=GENERA L

my recordsource is:
t_tran.dbf

it worked properly if i put my connection string in ado properties but when putting it in a variable it won't work anymore.

the t_tran.dbf is placed in different folder on every each day. which means, if today is jan, 18, 2007 then the directory would be c:\2007\01\18\t _tran.dbf and tomorrow, the data path will change because the date will be c:\2007\01\19.

So my option in opening the database is to select the date, then the path will change to the specific date.

Hope I explained it correctly.

Thanks in advance :)
Jan 18 '07 #1
3 2440
Killer42
8,435 Recognized Expert Expert
Can you show us the existing code? Replacing a hard-coded literal with a variable sounds simple, but there's always something that we weren't aware of.
Jan 19 '07 #2
Killer42
8,435 Recognized Expert Expert
...
this is my connection string:
Provider=VFPOLE DB.1;Data Source=D:\2007\ 01\18;Mode=Read ;Password="";Co llating Sequence=GENERA L
...
I'll take a quick stab at it. Sorry if this is not what you're after, but I'm using a lot of guess-work here. :)
Expand|Select|Wrap|Line Numbers
  1. Dim strConn As String
  2. strConn = "Provider=VFPOLEDB.1;Data Source=D:\" _
  3.   & format(Year(Now()) _
  4.   & "\" _
  5.   & Format(Month(Now(),"00") _
  6.   & "\" _
  7.   & Format(Day(Now(),"00") _
  8.   & ";Mode=Read;Password="""";Collating Sequence=GENERAL"
Jan 19 '07 #3
link
71 New Member
I'll take a quick stab at it. Sorry if this is not what you're after, but I'm using a lot of guess-work here. :)
Expand|Select|Wrap|Line Numbers
  1. Dim strConn As String
  2. strConn = "Provider=VFPOLEDB.1;Data Source=D:\" _
  3.   & format(Year(Now()) _
  4.   & "\" _
  5.   & Format(Month(Now(),"00") _
  6.   & "\" _
  7.   & Format(Day(Now(),"00") _
  8.   & ";Mode=Read;Password="""";Collating Sequence=GENERAL"
thanks Killer42,

here is my code...

Dim rs As New ADODB.Recordset
Dim cn As New ADODB.Connectio n

Private Sub Form_Load()

cn.Open ("Provider=VFPO LEDB.1;Data Source=D:\;Mode =Read;Password= "";Collatin g Sequence=MACHIN E")
rs.Open "select * from t_tran", cn

End Sub

I'm using ADO and datagrid, it works when i'm only using their properties but can't make it in coding.

I want to view the data using datagrid and put the data source as variable...exam ple as

xdata = "d:\"
Data Source=xdata

then view the content of the database using datagrid...is this possible sir?

thanks
Jan 26 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

21
6505
by: Dave | last post by:
After following Microsofts admonition to reformat my system before doing a final compilation of my app I got many warnings/errors upon compiling an rtf file created in word. I used the Help Workshop program: hcw.exe that's included with Visual Basic. This exact same file compiled perfectly with no notes, warnings or errors prior to...
9
4390
by: Tom | last post by:
A question for gui application programmers. . . I 've got some GUI programs, written in Python/wxPython, and I've got a help button and a help menu item. Also, I've got a compiled file made with the microsoft HTML workshop utility, lets call it c:\path\help.chm. My question is how do you launch it from the GUI? What logic do I put behind...
4
3335
by: Sarir Khamsi | last post by:
Is there a way to get help the way you get it from the Python interpreter (eg, 'help(dir)' gives help on the 'dir' command) in the module cmd.Cmd? I know how to add commands and help text to cmd.Cmd but I would also like to get the man-page-like help for classes and functions. Does anyone know how to do that? Thanks. Sarir
6
2998
by: d.warnermurray | last post by:
I am doing a project for school that involves creating help files for a html authoring tool. If you could help me with answers to some questions it would really help. 1. What tasks do you expect an html authoring tool to help you accomplish? 2. What do you expect from online help for a html authoring tool? 3. What audience do you think...
5
2975
by: Craig Keightley | last post by:
Please help, i have attached my page which worksin IE but i cannnot get the drop down menu to fucntion in firefox. Any one have any ideas why? Many Thanks Craig <<<<<<<<<<<<<<CODE>>>>>>>>>>>>>>>> <html>
5
3253
by: Steve | last post by:
I have written a help file (chm) for a DLL and referenced it using Help.ShowHelp My expectation is that a developer using my DLL would be able to access this help file during his development time using "F1" help within the VB IDE. Is this expectation achievable In trying to test my help file in the IDE, I have a solution with 2 projects:...
8
3210
by: Mark | last post by:
I have loaded Visual Studio .net on my home computer and my laptop, but my home computer has an abbreviated help screen not 2% of the help on my laptop. All the settings look the same on both including search the internet for help, but the help is worthless. Any ideas?
10
3343
by: JonathanOrlev | last post by:
Hello everybody, I wrote this comment in another message of mine, but decided to post it again as a standalone message. I think that Microsoft's Office 2003 help system is horrible, probably the worst I ever seen. I almost cannot find anything I need, including things I
1
6117
by: trunxnirvana007 | last post by:
'UPGRADE_WARNING: Array has a new behavior. Click for more: 'ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?keyword="9B7D5ADD-D8FE-4819-A36C-6DEDAF088CC7"' 'UPGRADE_WARNING: Couldn't resolve default property of object Label. Click for more:...
0
2862
by: hitencontractor | last post by:
I am working on .NET Version 2003 making an SDI application that calls MS Excel 2003. I added a menu item called "MyApp Help" in the end of the menu bar to show Help-> About. The application calls MS Excel, so the scenario is that I am supposed to see the Excel Menu bar, FILE EDIT VIEW INSERT ... HELP. I am able to see the menu bar, but in...
0
7695
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7922
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7668
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7964
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5509
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3653
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3637
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2111
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
936
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.